0

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:

enter image description here

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.

enter image description here

Does anyone know how to fix this issue?

Leo
  • 158
  • 4
arjunbnair
  • 25
  • 1
  • 2
  • 8
  • Since you're using the operator, the reconciliation loop is "fixing" your edits; you'll need to edit that [`Installation` custom resource](https://projectcalico.docs.tigera.io/reference/installation/api#operator.tigera.io/v1.InstallationSpec) and add `controlPlaneTolerations:` – mdaniel Jul 21 '22 at 18:35
  • Also, please don't post textual content as screenshots; it impairs searching, is hard to read, and is explicitly mentioned in the [how to ask](https://serverfault.com/help/how-to-ask) page – mdaniel Jul 21 '22 at 18:36
  • @mdaniel - Could you please explain this a bit specific? Didnt catch the idea pretty well. Maybe you can post the solution as an answer. – arjunbnair Jul 22 '22 at 07:42
  • 1
    I don't have a "solution," and I don't use their operator in order to test it. But that `kubectl apply` of `custom-resources.yaml` created an `Installation` object, but their object doesn't meet your needs. So you can download that file and edit it, or `kubectl edit $whatever_the_api_resource_name_is_of_Installation` to just patch the one that is in-cluster – mdaniel Jul 22 '22 at 15:46
  • Mmm. Okay Thank you. – arjunbnair Jul 25 '22 at 05:25

0 Answers0