Kubelet is failing to connect to kube-apiserver

Hey guys,

I’m going through the CKA exam questions and there is an error while kubelet is failing to connect to kube-apiserver, here is the description:

Q:
On cluster4 we are having some weird issue where we are intermittently getting below error while running kubectl commands.
***
Whenever you get this error, you can wait for 10-15 seconds to make kubectl command work again, but it will come again after few second

A:
From this we can see that the Liveness probe is failing for the kube-apiserver-cluster4-controlplane pod, and we can see its trying to connect to port 6444 port but the default api port is 6443. So let's look into the kube api server manifest.
**
Under livenessProbe: you will see the port: value is 6444, change it to 6443 and save. Now wait for few seconds let the kube api pod come up.

So, changing the liveness probe port gives me nothing even in case I restart kubelet service. What am I missing here?

When the liveness probe fails, kube-apiserver’s container will get restarted; hence the cycling behavior. Fixing the liveness probe to use the correct port should stop the cycling, on the assumption you did that correctly and did not introduce some other error to the manifest file.