美文网首页云计算
由于 ccm taints 导致coredns 无法调度的问题

由于 ccm taints 导致coredns 无法调度的问题

作者: cloudFans | 来源:发表于2021-07-31 20:12 被阅读0次

    [root@pro-master-01 ~]# kubectl describe pod -n kube-system coredns | grep -A 3 Events
    Events:
    Type Reason Age From Message


    Warning FailedScheduling 9h default-scheduler 0/6 nodes are available: 6 node(s) had taint {node.cloudprovider.kubernetes.io/uninitialized: true}, that the pod didn't tolerate.

    
    # 查看node的taints
    
    ## 1. 启用ccm的集群
    [root@pro-master-01 ~]# kubectl get nodes -o json | jq '.items[].spec.taints'
    [
      {
        "effect": "NoSchedule",
        "key": "node-role.kubernetes.io/master"
      },
      {
        "effect": "NoSchedule",
        "key": "node.cloudprovider.kubernetes.io/uninitialized",
        "value": "true"
      }
    ]
    [
      {
        "effect": "NoSchedule",
        "key": "node-role.kubernetes.io/master"
      },
      {
        "effect": "NoSchedule",
        "key": "node.cloudprovider.kubernetes.io/uninitialized",
        "value": "true"
      }
    ]
    [
      {
        "effect": "NoSchedule",
        "key": "node-role.kubernetes.io/master"
      },
      {
        "effect": "NoSchedule",
        "key": "node.cloudprovider.kubernetes.io/uninitialized",
        "value": "true"
      }
    ]
    [
      {
        "effect": "NoSchedule",
        "key": "node.cloudprovider.kubernetes.io/uninitialized",
        "value": "true"
      }
    ]
    [
      {
        "effect": "NoSchedule",
        "key": "node.cloudprovider.kubernetes.io/uninitialized",
        "value": "true"
      }
    ]
    [
      {
        "effect": "NoSchedule",
        "key": "node.cloudprovider.kubernetes.io/uninitialized",
        "value": "true"
      }
    ]
    
    
    ## 2. 未启用ccm的集群
    
    [root@okd-m1 ~]# kubectl get nodes -o json | jq '.items[].spec.taints'
    null
    null
    null
    null
    null
    

    kubespray 部署逻辑

    
    (py3env) [root@deployer env-prod-test-on-prem]# grep node.cloudprovider.kubernetes.io -r /root/k8s-cluster-manifests/
    /root/k8s-cluster-manifests/roles/addon-node-select/files/openstack-cloud-controller-manager.yaml:        key: node.cloudprovider.kubernetes.io/uninitialized
    /root/k8s-cluster-manifests/roles/openstack-ccm-patch/templates/external-openstack-cloud-controller-manager-deploy.yml.j2:      - key: node.cloudprovider.kubernetes.io/uninitialized
    /root/k8s-cluster-manifests/vendor/kubespray/roles/kubernetes-apps/cloud_controller/oci/templates/oci-cloud-provider.yml.j2:      - key: node.cloudprovider.kubernetes.io/uninitialized
    /root/k8s-cluster-manifests/vendor/kubespray/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-controller-manager-ds.yml.j2:      - key: node.cloudprovider.kubernetes.io/uninitialized
    /root/k8s-cluster-manifests/vendor/kubespray/roles/kubernetes-apps/external_cloud_controller/vsphere/templates/external-vsphere-cloud-controller-manager-ds.yml.j2:      - key: node.cloudprovider.kubernetes.io/uninitialized
    
    
    
    

    解决方式:
    提供一组没有该taints的node 即可

    至少两台

    
     kubectl taint nodes pro-worker-01 node.cloudprovider.kubernetes.io/uninitialized-
    
    kubectl taint nodes pro-worker-02 node.cloudprovider.kubernetes.io/uninitialized-
    
    
    

    参考:
    https://stackoverflow.com/questions/43379415/how-can-i-list-the-taints-on-kubernetes-nodes

    相关文章

      网友评论

        本文标题:由于 ccm taints 导致coredns 无法调度的问题

        本文链接:https://www.haomeiwen.com/subject/prukvltx.html