upgrading AKS in the real world

Varma 1,495 Reputation points
2024-08-17T06:36:57.8+00:00

What is the process to upgrade the AKS cluster in real-time and could you please provide me high-level steps to achieve the same?

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,459 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 50,895 Reputation points MVP Volunteer Moderator
    2024-08-17T11:08:38.22+00:00
    1. Prepare for the Upgrade
    • Review Release Notes: Before initiating an upgrade, review the Kubernetes release notes to understand the changes, deprecations, and new features.
    • Backup Your Data: Although the upgrade process is designed to be safe, ensure that you have backups of your data and application configurations.
    • Check Cluster Health: Ensure that the cluster is in a healthy state. You can do this by running kubectl get nodes and kubectl get pods --all-namespaces to ensure that there are no issues.
    1. Plan the Upgrade
    • Select the Target Version: Decide which Kubernetes version you want to upgrade to. AKS supports upgrading to a newer minor or patch version.
    • Review Node Pool Upgrades: If you have multiple node pools, plan the upgrade for each pool, keeping in mind that the upgrade process is performed sequentially, not in parallel.
    1. Upgrade the Cluster Control Plane
    • Initiate Control Plane Upgrade: Start by upgrading the AKS control plane. This can be done through the Azure portal, Azure CLI, or PowerShell.
        az aks upgrade --resource-group <ResourceGroupName> --name <ClusterName> --kubernetes-version <KubernetesVersion>
        
      
    • The control plane upgrade is a managed process, meaning Azure will handle the upgrade and any necessary restarts automatically.
    1. Upgrade Node Pools
    • Upgrade Node Pools Individually: After the control plane is upgraded, proceed to upgrade the node pools. This can also be done via the Azure portal, Azure CLI, or PowerShell.
        az aks nodepool upgrade --resource-group <ResourceGroupName> --cluster-name <ClusterName> --name <NodePoolName> --kubernetes-version <KubernetesVersion>
        
      
    • Rolling Upgrade: AKS performs a rolling upgrade for the nodes, meaning nodes are upgraded one by one. This helps maintain high availability during the upgrade process.
    1. Monitor the Upgrade Process
    • Monitor Node Status: During the upgrade, monitor the node status using kubectl get nodes to see when nodes are drained, upgraded, and returned to service.
    • Monitor Workloads: Ensure that your workloads are rescheduled onto upgraded nodes and that there are no issues with pod restarts or failures.
    1. Post-Upgrade Validation
    • Validate Cluster Functionality: After the upgrade is complete, validate that the cluster is functioning as expected. Check the status of all nodes and pods to ensure that they are healthy.
    • Test Applications: Perform tests on your applications to ensure they are running correctly with the new Kubernetes version.
    • Update Dependencies: If necessary, update any cluster dependencies, such as Helm charts or third-party tools, to versions compatible with the upgraded Kubernetes version.
    1. Cleanup and Final Checks
    • Clean Up Resources: If any temporary resources or configurations were created during the upgrade process, ensure they are cleaned up.
    • Update Documentation: Update your operational documentation to reflect the new Kubernetes version and any changes made during the upgrade process.
    • Set Up Alerts: Re-enable any alerts or monitoring that may have been paused during the upgrade process.

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.