<p>Today my kubernetes cluster v1.15.2 give me this error: <code>1 node(s) had taints that the pod didn't tolerate</code> and the pods could not start.</p>
<p>It tells me one nodes have taints and I check the node status and works fine, how to know it exactly have taints?</p>
<p>I am searching from internet and all tells me that master node could not allocate for pods running by default. But now my kubernetes pods is not running a master node.</p>
<ul>
<li>What may cause my node have taints(for example this node have not enough resource)?</li>
<li>What should I do to find out the taints of the node and fix it?</li>
</ul>

<p>You can use <code>kubectl describe node &lt;nodename&gt;</code> to check taints.</p>
<pre><code>kubectl describe node masternode
Name:               masternode
Roles:              master
Labels:             beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/os=linux
                    kubernetes.io/arch=amd64
                    kubernetes.io/hostname=ip-10-0-0-115
                    kubernetes.io/os=linux
                    node-role.kubernetes.io/master=
Annotations:        kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock
                    node.alpha.kubernetes.io/ttl: 0
                    projectcalico.org/IPv4Address: 10.0.0.115/24
                    projectcalico.org/IPv4IPIPTunnelAddr: 192.168.217.0
                    volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Thu, 18 Jun 2020 10:21:48 +0530
Taints:             node-role.kubernetes.io/master:NoSchedule
</code></pre>
<p>The node controller automatically taints a Node when certain conditions are true. The following taints are built in:</p>
<p><code>node.kubernetes.io/not-ready</code>: Node is not ready. This corresponds to the NodeCondition Ready being &quot;False&quot;.</p>
<p><code>node.kubernetes.io/unreachable</code>: Node is unreachable from the node controller. This corresponds to the NodeCondition Ready being &quot;Unknown&quot;.</p>
<p><code>node.kubernetes.io/out-of-disk</code>: Node becomes out of disk.</p>
<p><code>node.kubernetes.io/memory-pressure</code>: Node has memory pressure.</p>
<p><code>node.kubernetes.io/disk-pressure</code>: Node has disk pressure.</p>
<p><code>node.kubernetes.io/network-unavailable</code>: Node's network is unavailable.</p>
<p><code>node.kubernetes.io/unschedulable</code>: Node is unschedulable.</p>
<p><code>node.cloudprovider.kubernetes.io/uninitialized</code>: When the kubelet is started with &quot;external&quot; cloud provider, this taint is set on a node to mark it as unusable. After a controller from the cloud-controller-manager initializes this node, the kubelet removes this taint.</p>
<p>Along with above a special taint <code>node-role.kubernetes.io/master:NoSchedule</code> is added by default to master nodes.</p>
<p>The error typically comes if there is a <code>taint</code> on nodes for which you don't have corresponding <code>toleration</code> in pod spec.</p>
<p>Below is an example pod with toleration.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    env: test
spec:
  containers:
  - name: nginx
    image: nginx
    imagePullPolicy: IfNotPresent
  tolerations:
  - key: &quot;example-key&quot;
    operator: &quot;Exists&quot;
    effect: &quot;NoSchedule&quot;
</code></pre>
