I was trying to setup a Kubernetes Cluster using Amazon EC2 and Kubeadm. I created a 't2.large' EC2 instance based on Ubuntu 18.04 AMI. Setup kubeadm, kubelet, kubectl and docker as the container runtime.
Ran the kubeadm init --pod-network-cidr=192.168.0.0/16
command and the control-planes like 'kube-api-server', 'scheduler', 'controller',etc got created.
For the Container Network Interface, I was intending to use Calico. I followed the following link to install Calico in my Kubernetes cluster: https://projectcalico.docs.tigera.io/getting-started/kubernetes/quickstart
I ran the following commands to install Calico:
kubeadm init --pod-network-cidr=192.168.0.0/16
kubectl create -f https://projectcalico.docs.tigera.io/manifests/tigera-operator.yaml
kubectl create -f https://projectcalico.docs.tigera.io/manifests/custom-resources.yaml
As soon as these commands are run, the calico pods will get created, but some pods are in pending state:
After describing the pod, it says that it's unable to tolerate the taint node-role.kubernetes.io/control-plane
.
In the instructions from the link, it's mentioned that we need to untaint the master node for the pods to get scheduled.
As an alternative, I tried to edit the deployment ** calico-kube-controllers** and add the following tolerance in order to schedule the pod in the master node:
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
The solution works for a moment. The pod gets scheduled into the master node for a while. After few minutes, the pod is terminated and again goes back to pending state.
When I edited the deployment again, the line of code that I added for the tolerance is not there anymore. I can't find a clear reason why this is happening.
Does anyone know how to fix this issue?
Installation
custom resource and addcontrolPlaneTolerations:
kubectl apply
ofcustom-resources.yaml
created anInstallation
object, but their object doesn't meet your needs. So you can download that file and edit it, orkubectl edit $whatever_the_api_resource_name_is_of_Installation
to just patch the one that is in-cluster