Spec:
- OS: Ubuntu 20.04
- kubernetes version: 1.21.1
As far as I know, there will be taints on master node by default (node-role.kubernetes.io/master
). However, there is no taint on any master node on my cluster
root@master3:~# `kubectl get node `
`NAME STATUS ROLES AGE VERSION`
`master1 Ready control-plane,master 25h v1.21.1`
`master2 Ready control-plane,master 25h v1.21.1`
`master3 Ready control-plane,master 25h v1.21.1`
`worker1 Ready <none> 25h v1.21.1`
`worker2 Ready <none> 25h v1.21.1`
root@master3:~# `kubectl describe node master | grep -i taints`
`Taints: <none>`<p>
`Taints: <none>`<p>
`Taints: <none>`<p>
And some pods are scheduled on master node
root@master3:~# kubectl get pod -o wide | grep master <p>
nginx-test-5dbdb6f988-dfmcv 1/1 Running 0 23m 10.233.97.35 master1 <none> <none><p>
nginx-test-5dbdb6f988-flm4h 1/1 Running 0 22m 10.233.97.36 master1 <none> <none><p>
Here is the yaml for deployment nginx-test
root@master3:~# `kubectl get deployment nginx-test -o yaml`<p>
`apiVersion: apps/v1`<p>
`kind: Deployment`<p>
`metadata:`<p>
` annotations:`<p>
` deployment.kubernetes.io/revision: "10"`<p>
` creationTimestamp: "2021-07-06T01:33:19Z"`<p>
` generation: 23`<p>
` labels:`<p>
` app: nginx-test`<p>
` name: nginx-test`<p>
` namespace: default`<p>
` resourceVersion: "175269"`<p>
` uid: 4a08b870-1b31-4d66-b39f-d25c70e4e22d`<p>
`spec:`<p>
` progressDeadlineSeconds: 600`<p>
` replicas: 15`<p>
` revisionHistoryLimit: 10`<p>
` selector:`<p>
` matchLabels:`<p>
` app: nginx-test`<p>
` strategy:`<p>
` rollingUpdate:`<p>
` maxSurge: 25%`<p>
` maxUnavailable: 25%`<p>
` type: RollingUpdate`<p>
` template:`<p>
` metadata:`<p>
` annotations:`<p>
` kubectl.kubernetes.io/restartedAt: "2021-07-06T14:52:42+09:00"`<p>
` creationTimestamp: null`<p>
` labels:`<p>
` app: nginx-test`<p>
` spec:`<p>
` containers:`<p>
` - image: nginx`<p>
` imagePullPolicy: Always`<p>
` name: nginx`<p>
` resources: {}`<p>
` terminationMessagePath: /dev/termination-log`<p>
` terminationMessagePolicy: File`<p>
` dnsPolicy: ClusterFirst`<p>
` restartPolicy: Always`<p>
` schedulerName: default-scheduler`<p>
` securityContext: {}`<p>
` terminationGracePeriodSeconds: 30`<p>
`status:`<p>
` availableReplicas: 15`<p>
` conditions:`<p>
` - lastTransitionTime: "2021-07-06T05:44:30Z"`<p>
` lastUpdateTime: "2021-07-06T05:44:30Z"`<p>
` message: Deployment has minimum availability.`<p>
` reason: MinimumReplicasAvailable`<p>
` status: "True"`<p>
` type: Available`<p>
` - lastTransitionTime: "2021-07-06T01:33:19Z"`<p>
` lastUpdateTime: "2021-07-06T06:03:41Z"`<p>
` message: ReplicaSet "nginx-test-5dbdb6f988" has successfully progressed.`<p>
` reason: NewReplicaSetAvailable`<p>
` status: "True"`<p>
` type: Progressing`<p>
` observedGeneration: 23`<p>
` readyReplicas: 15`<p>
` replicas: 15`<p>
` updatedReplicas: 15`<p>
2
Answers
Taints on control plane nodes are not required. It all depends on how you installed Kubernetes and how it wants things to be. Single node installers, for example, don’t set them up or nothing would be able to run.
As I already mentioned in my previous comment, the issue was due to the fact that the master node was listed under the
[kube-node]
section of Kubespray inventory file instead of the proper[kube-master]
section. That caused the taints to be removed. Putting the master node in the[kube-master]
section will fix the problem.