常用命令:
kubectl get pods -o wide
kubectl get nodes
kubectl get pods
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: myweb
spec:
replicas: 2
template:
metadata:
labels:
app: myweb
spec:
containers:
- name: myweb
image: docker.io/tomcat
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: myweb
spec:
ports:
- port: 8099
targetPort: 8080
nodePort: 31111
selector:
app: myweb
type: NodePort
问题1 (加证书)
问题2(第一个创建资源对象一直为ContainerCreating大坑)
KUBELET_ARGS="–cluster-dns=192.168.20.22 --cluster-domain=playcrab-inc.com"
访问测试:http://192.168.20.88:31111/ 获取其他节点也可以