[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
网友评论