I'm trying to initialize my Kubernetes cluster on Ubuntu 22.04 using the command sudo kubeadm init --apiserver-advertise-address=192.168.122.60 --pod-network-cidr=10.100.0.0/16, but it's not working. The kube-api-server keeps going into a crashloop. I've tried a bunch of troubleshooting steps including modifying the /etc/containerd/config.toml to set SystemCgroup to true, reinstalling containerd multiple times, and even starting over with a new VM. I'm at a loss here. My logs show multiple connection refused errors when trying to connect to 127.0.0.1:2379. Does anyone have any ideas on how to resolve this?
5 Answers
I've faced a similar issue. You might want to check your node init script and ensure you're enabling cgroups by changing this line in the config: sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml. Remember to restart containerd after making changes!
It sounds like you might need to activate the enp0s8 interface and assign the correct IP address. Make sure your network settings are properly configured on the VM.
What do you mean by that? I only see the enp0s4 interface on my Ubuntu setup.
If you're having trouble connecting to port 2379, it could be an etcd issue. Make sure to check the logs from the etcd pod for any startup errors. You can usually find the logs in /var/log/pods/ to help diagnose the problem.
You could check the kube-api-server and containerd logs for more clues. I had a similar crash loop when my certs expired, but if this is a fresh install, that shouldn’t be the issue. Also, make sure that swap is disabled and AppArmor/SELinux is turned off. Sometimes starting with a newer version of Ubuntu, like 24.04, can avoid issues that arise with older versions.
I’ve checked that already. The logs show a connection refused error specifically for tcp 127.0.0.1:2379. I don't even have a firewall running.
When I set up my cluster on VirtualBox, I was able to specify the IP address during the Ubuntu Server installation. If you didn't see that option, try remounting the ISO before starting your VM; it should give you a setup UI to enter the IP address.
I’ve already set that to true but I'm still having issues...