Ingress Nginx cant tolerate Master taint

Viewed 361

Problem

When trying to install ingress-nginx on a single node (also master) Kubernetes cluster, the Helm install fails complaining pod can't be scheduled on master as it cant tolerate the taint of master:

   - FailedScheduling  
   - pod/ingress-nginx-admission-create--1-n7bhg  
   -  0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate.  

Details

Kubernetes :

Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2", GitCommit:"8b5a19147530eaac9476b0ab82980b4088bbc1b2", GitTreeState:"clean", BuildDate:"2021-09-15T21:32:41Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}

Helm Version:

  version.BuildInfo{Version:"v3.7.0", GitCommit:"eeac83883cb4014fe60267ec6373570374ce770b", GitTreeState:"clean", GoVersion:"go1.16.8"}

Installation steps followed : ( from documentation at https://kubernetes.github.io/ingress-nginx/deploy/#using-helm )

  helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx  
  helm repo update  
  helm install ingress-nginx ingress-nginx/ingress-nginx  

Cluster node:

ip-172-29-1-103   Ready    control-plane,master   81m   v1.22.2   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=ip-172-29-1-103,kubernetes.io/os=linux,mitg.cisco.com/node-type=pats,node-role.kubernetes.io/control-plane=,node-role.kubernetes.io/master=,node.kubernetes.io/exclude-from-external-load-balancers=

Removing the master node taint doesn't look right for other reasons. What would be a solution ?

1 Answers

In general, to get workloads schedules on the Kubernetes Control Plane (I.e. Master nodes), you need to do the following:

kubectl taint nodes --all node-role.kubernetes.io/master-

or 1.7 and above:

kubectl taint node mymasternode node-role.kubernetes.io/master:NoSchedule-

In order for you to find out what the master node is currently tainted with you can describe the node and look at the labels and taints associated with the node in question. What this does is it will untaint the master node and allow workloads to be scheduled to that node. Essentially find the taint fo the node in question and untaint the master node in question that is preventing it. Without any descriptions on your node, or the resources that are failing that's the best advice I can give. So it sounds like you didn't properly remove the taint that prevents scheduling to your master node, which by default workloads are restricted to the master node.

You can also spin up a worker node and try to join it to your cluster to overcome the issue and see if it gets scheduled to the joined worker.

My best advice is to find your taint:

kubectl describe node <insert-node-name-here>

Find the taints and/or tolerations that are preventing it and remove it. Read through the following to see if it helps you:

NOTE: THIS SHOULD NOT BE DONE ON PRODUCTION CLUSTERS, SO I ASSUME THIS IS A DEVELOPMENT CLUSTER YOU ARE WORKING WITH *****

Related