常用命令:

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/ 获取其他节点也可以

参考原文链接:

https://www.cnblogs.com/spll/p/10075781.html

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐