Anybody ran into issues when setting up a cluster following the steps from the v . . .

dnz:
Anybody ran into issues when setting up a cluster following the steps from the video, “Demo - Deployment with Kubeadm”?

After setting up just one master node (VM is ubuntu <http://22.as|22.04.2 LTS, 2vCPU, 4GB ram, 60GB storage) as> a start and going through the steps up to the part of kubeadm init , verifying the cluster with kubectl get po -A worked initially but then after a few minutes of running different kubectl commands, I would eventually end up with this error, “<https://discuss.kubernetes.io/t/the-connection-to-the-server-host-6443-was-refused-did-you-specify-the-right-host-or-port/552|connection to the server <host>:6443 was refused - did you specify the right host or port?>”
I tried all the options i found scouring through various forums:
• make sure swap is off
• make sure firewall is off
• make sure you have enough disk space
• make sure container is running (in my case, i’m using containerd)
• using the kube config file correctly
• restarted kubelet a million times
• restart OS
• try stand on one leg :slight_smile:
• … (and more)
What finally fixed it for me is to re-create the file, /etc/containerd/config.toml by dumping containerd defaults and modifying it to set the SystemdCgroup = true as follows:

containerd config default | sudo tee /etc/containerd/config.toml

and then modifying the file to set SystemdCgroup = true .

After this, everything just worked! I went back and reset the config.toml file as suggested in the video and the error resurfaced so it is easily re-creatable.

So the step from the course where it says to only set the /etc/containerd/config.toml to just a few lines below was causing the issue for me.

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
  [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
    SystemdCgroup = true

I guess my qestion is… is this a known issue or documented somewhere? Seems like the steps from the course needs to be updated or call this issue out, I spent hours trying to get this resolved. I’m not sure what’s causing it and if it just unique to Ubuntu 22.04.2?
Perhaps it could also be the version of kubernetes I was installing is 1.24.3? The reason for the lower version is for practice upgrading it later on.

clement cheuk:
I got this problem too. how u solve this problem.

dnz:
First, I created config.toml file from containerd configuration defaults using command below:

containerd config default | sudo tee /etc/containerd/config.toml

The resulting file will contain a long list of other containerd configurations.

Then update config.toml by first finding SystemdCgroup property under the section plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options and set value to true .

The course video demonstrated that only 3 lines were needed but this did not work for me and was only able to resolve it by the steps above.

dnz:
I will experiment more later tonight on what actually made it work, I have some theories but have yet to give it a try. In the meantime, the above description should at least get you going.

fishr:
I wasn’t able to replicate the issue on AWS with ubuntu 22.04.
Maybe try to ping the ip of the control plane to see if it responds ?
If you’re experimenting in the cloud, make sure to set the control-plane endpoint to the public ip of the server you’re running kubeadm init on

dnz:
Not using any cloud at all, it’s just one simple VM.
VM never lost network connection and I know that for sure as I was ssh’d into it otherwise it would have kicked me out.

I had the same issue and followed a similar path. My pods were crashing constantly and I would get an error message that would indicate that the api server was not accessible on 6443 on an intermittent basis. I turned swapoff -a and this helped me get a list of nodes / pods and I observed that my proxy and weave pods were in a constant state of crashloop backoff. I wasn’t able to discern much from the logs.

I happened to be a customer on udemy as well and looked at the notes for that particular exercise. It was there that it was noted to update the config.toml. Like the previous poster, I had deleted all but three lines according to instructions.

The config that actually worked for me was:

version = 2

[plugins]

[plugins.“io.containerd.grpc.v1.cri”]

[plugins.“io.containerd.grpc.v1.cri”.containerd]

  [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]

    [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]

      runtime_type = "io.containerd.runc.v2"

      [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]

        SystemdCgroup = true

As posted in the udemy forum:

https://www.udemy.com/course/certified-kubernetes-administrator-with-practice-tests/learn/lecture/20666298#questions/20950906