When creating a small Kubernetes cluster with 3 nodes, you might want to make the control plane node also a worker. Remember that on larger clusters it's recommended to not mix the responsabilities os the nodes.
To make a control plane node a worker you should run the following command:
kubectl label node <node-name> node-role.kubernetes.io/worker=worker
If we check the nodes status we cna see the first node now has both control-plane and worker roles.
kubectl get nodes
NAME STATUS ROLES AGE VERSION
eu-central-1.binarycomet.net Ready control-plane,worker 78m v1.32.3
eu-central-2.binarycomet.net Ready worker 53m v1.32.3
eu-central-3.binarycomet.net Ready worker 25m v1.32.3
The control plane might be tainted to not accept pods, you can check if that's your case running:
kubectl get nodes eu-central-1.binarycomet.net -o json | jq '.spec.taints'
If it's tainted it will output something similar to this, as you can see the effect NoSchedule
tells the cluster this node cannot be the host of pods.
[
{
"effect": "NoSchedule",
"key": "node-role.kubernetes.io/control-plane"
}
]
To remove that effect run the following command, if your taint key is different adapt it to your cluster:
kubectl taint nodes eu-central-1.binarycomet.net node-role.kubernetes.io/master:NoSchedule-