??Upgrading Your Kubernetes Cluster??
Kubernetes

??Upgrading Your Kubernetes Cluster??

Upgrading your Kubernetes cluster to the next minor version brings new features and improvements. Here's a step-by-step guide to transition from Kubernetes v1.29 to v1.30, ensuring your environment is properly configured.

Steps on the control plane node:

  • Drain the control plane node :

kubectl drain controlplane --ignore-daemonsets        

The drain command prepares the node for maintenance by safely evicting running workloads. Use the --ignore-daemonsets flag to ensure critical daemonset pods remain running, avoiding disruption of system-level services during the upgrade.

  • Open the Kubernetes apt repository file:

vim /etc/apt/sources.list.d/kubernetes.list        

Edit this file to point to the correct Kubernetes repository URL for v1.30.

  • Update the repository URL to v1.30:

deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /
        

This ensures you’re fetching the correct package versions for the upgrade.

  • Refresh the apt cache and verify kubeadm versions:

apt update
apt-cache madison kubeadm
        

These commands help you confirm that the v1.30.0 packages are available for installation.

  • Install the updated kubeadm:

apt-get install kubeadm=1.30.0-1.1
        

Kubeadm helps manage the Kubernetes cluster lifecycle, including upgrades.

  • Upgrade the Kubernetes cluster:

kubeadm upgrade plan v1.30.0
kubeadm upgrade apply v1.30.0
        

This initiates the upgrade of the control plane to v1.30, ensuring a smooth transition

  • Upgrade kubelet and restart the service :

apt-get install kubelet=1.30.0-1.1

systemctl daemon-reload

systemctl restart kubelet        

The kubelet service manages the nodes in your Kubernetes cluster, and upgrading it ensures compatibility with the new Kubernetes version.

  • Mark the control plane node as schedulable again:

kubectl uncordon controlplane        

After the upgrade, you need to make the node available again to schedule new pods. The uncordon command removes the restriction, allowing new workloads to be scheduled on the control plane node.


By following these steps, you'll smoothly transition to Kubernetes v1.30, taking full advantage of the new features and improvements!


#Kubernetes #DevOps #CloudComputing #KubernetesUpgrade #TechTips #Automation #DevOpsEngineer #Backup






Kadir Goksal

DevOps Engineer | Cloud Engineer | AWS Solution Architect | Python | Linux | Bash | AWS | Azure | CI/CD | Jenkins | Docker | Ansible | CKA, Azure, Terraform Certified

3 周

Very helpful, thanks for sharing.

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

社区洞察

其他会员也浏览了