alessandrolomanto / k8s-containerd-containerday2021

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prerequisites

To follow Vagrant tutorial, you need:

Step 1 - Start Kubernetes Vagrant cluster

make vagrant-start

Step 2 - Try Kubernetes Cluster

vagrant ssh master
kubectl get all --all-namespaces

Step Destroy - Delete Kubernetes Cluster and Machine

make vagrant-destroy

View kubelet log for dockershim deprecation

  • Open var/log/syslog
cat var/log/syslog | grep dockershim 

Configure containerd as container runtime

Drain node because of scheduler

kubectl drain node-2 --ignore-daemonsets

SSH to node

  • Password kubeadmin
ssh root@node-2

Stop kubelet and docker services

systemctl stop kubelet
systemctl stop docker

Remove Docker software

apt remove --purge docker-ce docker-ce-cli

Make sure that containerd configuration allows disabled_plugin

  • Comment #disabled_plugins=["cri"]
vi /etc/containerd/config.toml 

Restart containerd

systemctl restart containerd

Change kubelet configuration

  • Add --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock
vi /var/lib/kubelet/kubeadm-flags.env

Start kubelet and return controlplane

systemctl start kubelet
exit

Make node-2 avaible and try new deployment

kubectl uncordon node-2
kubectl create deploy nginx --image=nginx --replicas=4
  • kubectl get pods -o wide - To see that the pods are running in both nodes

About


Languages

Language:Shell 94.4%Language:Makefile 3.0%Language:Dockerfile 2.6%