k8s集群管理注意要点【持续更新】

1.编写pod yaml文件时绑定调度标签,必须要给指定节点绑定标签,否则无法调度到指定节点上,报错:

Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  62s (x2 over 62s)  default-scheduler  0/2 nodes are available: 1 node(s) didn't have free ports for the requested pod ports, 1 node(s) didn't match node selector.

给节点绑定标签:

kubectl label nodes NODE_NAME ingress-name=ingress-true
kubectl label nodes NODE_NAME name=node02
kubectl get nodes --show-labels 更新标签:kubectl label nodes NODE_NAME name=node00 --overwrite

yaml文件指定调度标签:

    spec:
      hostNetwork: true
      serviceAccountName: nginx-ingress-serviceaccount
      nodeSelector:
        ingress-name: ingress-true
      containers:
        - name: nginx-ingress-controller
          image: lizhenliang/nginx-ingress-controller:0.20.0

 

2.

posted @ 2019-07-12 14:54  chenjianwen  阅读(1998)  评论(0编辑  收藏  举报