Skip to content

Kubernetes

Install Kubeadm

Install Kubeadm with the following steps:

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

Error with running kubeadm init

Error can be caused by containerd running.

Error seen: “CRI: container runtime is not running: output: time=“2024-05-27T17:40:33+01:00” level=fatal msg=“validate service connection: validate CRI v1 runtime API for endpoint "unix:///var/run/containerd/containerd.sock": rpc error: code = Unimplemented desc = unknown service "

fix by deleting the containerd config file and restarting containerd:

1
2
3
rm /etc/containerd/config.toml
systemctl restart containerd
kubeadm init

You may need to open the following ports to allow nodes to communicate with the control plane:

1
2
3
4
5
6
7
sudo firewall-cmd --permanent --add-port=6443/tcp
sudo firewall-cmd --permanent --add-port=2379-2380/tcp
sudo firewall-cmd --permanent --add-port=10250/tcp
sudo firewall-cmd --permanent --add-port=10251/tcp
sudo firewall-cmd --permanent --add-port=10252/tcp
sudo firewall-cmd --permanent --add-port=10255/tcp
sudo firewall-cmd –reload

Then open the following ports on the worker nodes:

1
2
3
sudo firewall-cmd --permanent --add-port=10251/tcp
sudo firewall-cmd --permanent --add-port=10255/tcp
firewall-cmd --reload

==Create Pod== Create pod with the following command:

1
kubectl apply -f pod.yaml #apply the config in the .yaml file

inspect the pods conents:

1
ps auxf

use ctl command to see base info:

1
sudo ctr --namespace=k8s.io containers ls

See running containers in the pod using ctl:

1
sudo crictl ps