Bring up a Sample K8s cluster with Containerd

No Docker

Alex Punnen
Techlogs
2 min readNov 30, 2020

--

Setup

We have one master and (optional) workers.

Make all firewall ports Open. You don’t want to get stuck here.

Main Reference https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/

Step 1- Install Containerd in all 4 Nodes — No docker needed

Follow this in all your 4 nodes https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd

We will configure systemd cgroups driver for containerd.

Note that there is a bug with the /etc/containerd/config.toml containerd-config-bug

It may be apparent in the next steps when you try to do kubeadm init or in the worker nodes kubeadm join.

The workaround is to delete this file and restart the containerd service and after that the kubelet service.

Step 2 Install kubelet,kubeadm and kubectl in all nodes

Install ‘kubelet kubeadm kubectl in all 4 nodes as is written here

https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/

Step 3 — In Master — do Kubeadm init and CNI plugin

Before that

  • Since we are using containerd we need to specify that
  • Since we are using Flannel , we need a specific pod cidr to be specified

Create a config.yaml with the following

In Master Node

Note — If you are getting an error as specified in the issue containerd-config-bug, do the workaround specified

On success, you should get

Do as it is printed

Next is POD network — we will use Flannel

  • Apply Container Networking in Master node

Step 4 — In all workers do kubeadm join

Note — If you are getting an error as specified in the issue containerd-config-bug, do the workaround specified

In case you find problems with node not joiining and gettting the error CNI Network not available do the workaround

Step 5 — Copy kubeconfig to your local machine

Your cluster should be up. Copy the kubeconfig from the master node (cat ~/.kube/config ) to your lapop

Since we have not configured SSL set the insercure option via kubectl in your laptop for easy working.

That’s it.

--

--

Alex Punnen
Techlogs

SW Architect/programmer- in various languages and technologies from 2001 to now. https://www.linkedin.com/in/alexpunnen/