Kubernetes Cluster Setup (v1.27.1)with containerd

Kubernetes Cluster Setup (v1.27.1)with containerd


Kubernetes Cluster Setup (v1.27.1




sudo apt-get update && apt-get upgrade -y
########################################################################################################
Load the Kernel modules on all the nodes


sudo tee /etc/modules-load.d/containerd.conf <<EOF
overlay
br_netfilter
EOF


sudo modprobe overlay
sudo modprobe br_netfilter


########################################################################################################
Set the following Kernel params for K8s


sudo tee /etc/sysctl.d/kubernetes.conf <<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
########################################################################################################


Reload the system changes
sudo sysctl --system


########################################################################################################
Install containerd run time


sudo apt install -y curl gnupg2 software-properties-common apt-transport-https ca-certificates


sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/docker.gpg


sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"


sudo apt update
sudo apt install -y containerd.io


#####################################################################################################
Configure containerd using systemd as cgroup


containerd config default | sudo tee /etc/containerd/config.toml >/dev/null 2>&1


sudo sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g' /etc/containerd/config.toml


sudo systemctl restart containerd
sudo systemctl enable containerd


###################################################################################################
Add apt repository for k8s


curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-add-repository "deb https://apt.kubernetes.io/ kubernetes-xenial main"


sudo apt update
sudo apt install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl


kubeadm init?


##################################################################################################
Install Pod Network addon:


curl https://raw.githubusercontent.com/projectcalico/calico/v3.25.1/manifests/calico.yaml -O

)
        



root@master01:~# kubectl get pods -n kube-syste
NAME? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?READY? ?STATUS? ? RESTARTS? ?AGE
calico-kube-controllers-674fff74c8-9z5m2? ?1/1? ? ?Running? ?0? ? ? ? ? 39m
calico-node-s5vsp? ? ? ? ? ? ? ? ? ? ? ? ? 1/1? ? ?Running? ?0? ? ? ? ? 39m
calico-node-sd8dk? ? ? ? ? ? ? ? ? ? ? ? ? 1/1? ? ?Running? ?0? ? ? ? ? 31m
coredns-5d78c9869d-hzm9p? ? ? ? ? ? ? ? ? ?1/1? ? ?Running? ?0? ? ? ? ? 40m
coredns-5d78c9869d-s9j8r? ? ? ? ? ? ? ? ? ?1/1? ? ?Running? ?0? ? ? ? ? 40m
etcd-master01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1/1? ? ?Running? ?0? ? ? ? ? 40m
kube-apiserver-master01? ? ? ? ? ? ? ? ? ? 1/1? ? ?Running? ?0? ? ? ? ? 40m
kube-controller-manager-master01? ? ? ? ? ?1/1? ? ?Running? ?0? ? ? ? ? 40m
kube-proxy-sk6l7? ? ? ? ? ? ? ? ? ? ? ? ? ?1/1? ? ?Running? ?0? ? ? ? ? 40m
kube-proxy-w9t9w? ? ? ? ? ? ? ? ? ? ? ? ? ?1/1? ? ?Running? ?0? ? ? ? ? 31m
kube-scheduler-master01? ? ? ? ? ? ? ? ? ? 1/1? ? ?Running? ?0? ? ? ? ? 40mm
        



root@master01:~# kubectl get pods -o wid
NAME? ? ? ? ? ? ? ? ? ?READY? ?STATUS? ? RESTARTS? ?AGE? ?IP? ? ? ? ? ? ? ?NODE? ? ?NOMINATED NODE? ?READINESS GATES
abc-7d7574dbff-t7wjw? ?1/1? ? ?Running? ?0? ? ? ? ? 31m? ?192.168.171.65? ?worker? ?<none>? ? ? ? ? ?<none>
xyz-5f98d7fcbb-bbfrr? ?1/1? ? ?Running? ?0? ? ? ? ? 8s? ? 192.168.171.66? ?worker? ?<none>? ? ? ? ? ?<none>
root@master01:~#

e        
Stanley Russel

??? Engineer & Manufacturer ?? | Internet Bonding routers to Video Servers | Network equipment production | ISP Independent IP address provider | Customized Packet level Encryption & Security ?? | On-premises Cloud ?

1 年

It sounds like a great setup! I'm sure you'll get a lot of benefits from running kubeadm 1.27.1 with containerd on Ubuntu 22.04. It would be interesting to find out if you noticed any performance improvements compared to other configurations. Also, have you thought about deploying a Kubernetes cluster across multiple nodes? It might be worth exploring.

回复

要查看或添加评论,请登录

Vikas Mathur的更多文章

社区洞察

其他会员也浏览了