I had posted about this previously in my Kubeadm deployment post, however I wanted to create a separate post for this because I had such a hard time figuring this issue out and I wanted to hopefully create some SEO to make someone else’s life easier in the future.
Basically the issue comes down to constantly getting a 6443 connection refused error for any kubectl command.
Sometimes I could briefly get it to work only to immediately fail again.
This response typically means there is an issue with the API server, and it cannot respond.
The solution however is pretty simple. The runtime I am using is containerd, so I just need to make a small change to the config file.
sudo nano /etc/containerd/config.toml
We need to change the the SystemdCgroup option to true:
Please also note this option is under “runc.options”.
Once I changed this to true, I stopped getting the 6443 connection refused errors. I personally found the solution buried in this thread, so hopefully this post will be easier to find.