Quantcast
Channel: tech cottage
Viewing all articles
Browse latest Browse all 48

Install kubernetes on containerd

$
0
0

Kubernetes is deprecating Docker as a container runtime after v1.20. This post shows how to install kubernetes on ubuntu 18.04 using containerd as a container runtime. For brevity, we do this just only on one node.

Below is a clean machine snap where we don't have docker installed.








We grab the 'cri-containerd-cni' package from https://storage.googleapis.com/cri-containerd-release and unpack it to the root directory:






Start containerd:







Next we follow the usual steps for installing kubernetes components from kubernetes documentation page:






lsmod | grep br_netfilter

modprobe br_netfilter

sysctl -w net.ipv4.ip_forward=1















Create Systemd Drop-In for Containerd/etc/systemd/system/kubelet.service.d/0-containerd.conf:
[Service]                                                 
Environment="KUBELET_EXTRA_ARGS=--container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=unix:///run/containerd/containerd.sock"

After  this we run kubeadm init 









We see that our control plane is up:
















kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"










Untaint the master node so that we can deploy a pod on it since we have only one node:

kubectl taint node k8s-containerd node-role.kubernetes.io/master:NoSchedule-










There you go - migrate to containerd from docker for kubernetes.



Viewing all articles
Browse latest Browse all 48

Trending Articles