Kubernetes Cluster Maintenance
Anup D Ghattikar
Data Reseach Analyst | Software Developer | Python | Django | Mysql | Devops
Kubernetes Cluster Upgrade
Upgrade master
Upgrading the control plane consist of the following steps:
Determine which version to upgrade to
apt update
apt-cache madison kubeadm
On the control plane node, run:
kubeadm upgrade plan
Upgrading kubeadm tool
apt-mark unhold kubeadm && \
apt-get update && apt-get install -y kubeadm=1.26.3-00 && \
apt-mark hold kubeadm
Verify that the download works and has the expected version:
kubeadm version
Drain the control plane node:
# replace <Node-Name> with the name of your control plane node
$ kubectl drain <Node-Name> --ignore-daemonsets --delete-local-data
On the control plane node, run:
kubeadm upgrade plan
On the control plane node, run:
kubeadm upgrade apply v1.26.3
Un cordon the control plane node:
$ kubectl uncordon <node name>
$ kubectl uncordon master
Upgrade kubelet and kubectl
$ apt-mark unhold kubelet kubectl && \
apt-get update && apt-get install -y kubelet=1.26.3-00 kubectl=1.26.3-00 && \
apt-mark hold kubelet kubectl
Restart the kubelet
$ systemctl daemon-reload
$ systemctl restart kubelet
Check Version
$ kubectl get nodes
领英推荐
The Master is Updated.
Upgrade Node
Upgrading the worker nodes consist of the following steps:
Kubectl get nodes
apt-mark unhold kubeadm && \
apt-get update && apt-get install -y kubeadm=1.26.3-00 && \
apt-mark hold kubeadm
Drain the Worker Node (perform this on master Machine)
kubectl drain <node-to-drain> --ignore-daemonsets
kubectl drain worker-02 --ignore-daemonsets
Upgrade kubelet config on worker node (perform this on Worker Machine)
kubeadm upgrade node
Upgrade kubelet and kubectl (perform this on Worker Machine)
apt-mark unhold kubelet kubectl && \
apt-get update && apt-get install -y kubelet=1.18.8-00 kubectl=1.18.8-00 && \
apt-mark hold kubelet kubectl
Restart the kubelet
systemctl daemon-reload
systemctl restart kubelet
Uncordon the node (perform this on the master Machine)
kubectl uncordon worker-02
Verify the status of the cluster
kubectl get nodes
Kubernetes Cluster upgraded successfully
Kubernetes backup & restore
The dynamic nature of Kubernetes environments presents challenges for traditional backup systems and techniques, with stricter requirements for Recovery Point Objective (RPO) and Recovery Time Objective (RTO). To address these challenges, three key features are recommended for enterprise backup solutions, including?disaster recovery, backup and restore, and local high availability. These features are considered essential best practices for Kubernetes backups.
Backup and Restore:
The backup process needs to be able to capture and save the entire Kubernetes app, including its?configuration, resources, and data, as a single unit for easy restoration. A proper Kubernetes backup system should be able to back up specific applications or groups of applications and the entire Kubernetes namespace. While it is similar to regular backup processes, Kubernetes?backup also requires specific features?like?retention,?scheduling, encryption, and tiering for?a more efficient backup and restore system
Associate Consultant at TCS
1 年Anup Ghattikar please let me know where I can get 49 days DevOps course content