/
AC Cloud customer AKS cluster version upgrade

AC Cloud customer AKS cluster version upgrade

Node Resizing vs AKS Cluster Upgrade

Node Resizing

Node resizing involves adjusting the size (compute capacity) of the nodes (VMs) within a Kubernetes cluster. This typically includes switching the VM type to a different SKU with varying CPU, memory, or storage configurations.

Purpose

  • Performance Adjustment: Scaling up to larger VMs or scaling down to smaller VMs to meet increased workload demands or reduce costs during periods of low demand.

  • Resource Optimization: Tailoring resource allocation to align with the specific needs of the applications.

 Process

  1. Identify Node Size: Begin by determining the new size required for the nodes.

  2. Drain the Node: Safely evict all pods from the node to be resized to avoid any downtime.

    kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data
  3. Change VM Size: Proceed to adjust the size of the VM either through the cloud provider's management console or via CLI.

  4. Update the Cluster: Implement the changes to the node size within the Kubernetes cluster.

  5. Uncordon() the Node: Reintegrate the node back into the cluster.

    kubectl uncordon <node-name>

  

NOTE:- The uncordon command reverses the actions of cordon, allowing a previously unschedulable node to be marked as schedulable once more. After uncordoning, the node becomes capable of accepting new pods for scheduling.

 Implications

  • Performance Impact: Scaling up can enhance performance, while scaling down can reduce costs.

  • Disruption: Temporary disruption may occur when draining and resizing nodes, but utilizing kubectl drain effectively minimizes downtime.

  • No Version Change: The Kubernetes version stays constant; only the node size is altered.

Upgrading an AKS Cluster

AKS cluster upgrade entails enhancing the Kubernetes version of the AKS cluster. This process includes upgrading both the control plane and the nodes to a more recent version of Kubernetes.

Purpose

  • New Features: Access new features and enhancements introduced in the latest Kubernetes versions.

  • Security Patches: Implement security patches and bug fixes to enhance system security.

  • Compatibility: Guarantee compatibility with the latest application versions and functionalities.

Process

  1. Plan the Upgrade: Begin by reviewing the release notes of the new Kubernetes version and carefully plan the upgrade process.

  2. Upgrade the Control Plane: Proceed with upgrading the AKS control plane to the desired version using the following command:

    az aks upgrade --resource-group <resource-group-name> --name <cluster-name> --kubernetes-version <new-version>
  3. Upgrade the Node Pools: Next, upgrade the node pools to align with the version of the control plane by executing the command below:

  4. Monitor the Upgrade: Ensure the upgrade process is successfully completed by monitoring the cluster state.

 Key Implications

  • Feature Access: Unlock new Kubernetes features and enhancements.

  • Security: Benefit from heightened security with the most recent patches.

  • Potential Downtime: Be prepared for potential temporary disruptions, particularly if the upgrade process is not adequately planned.

  • Resource Requirements: Upgrading could necessitate additional resources or adjustments to resource configurations.


As part of the application and cluster lifecycle, you might want to upgrade to the latest available version of Kubernetes. You can upgrade your Azure Kubernetes Service (AKS) cluster using the Azure CLI, Azure PowerShell, or the Azure portal.

Check for Available AKS Cluster Upgrade

  1. Navigate to Azure Portal:

  • Go to the Azure portal and search for Kubernetes services.

  1. Check Current AKS Version:

  • Click on the Upgrade version option for the client you are upgrading to view the current AKS version.

When upgrading a supported AKS cluster, it is essential to follow a sequential upgrade process for Kubernetes minor versions. Each upgrade must be carried out in order of major version numbers. For instance:

  • Transitioning between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x is permissible.

  • However, upgrading directly from 1.14.x -> 1.16.x is not supported.

The option to skip multiple versions is only applicable when moving from an unsupported version to a supported one. For instance:

  • It is acceptable to upgrade from an unsupported 1.10.x to a supported 1.12.x if the latter is available.

Upgrade an AKS Cluster

  • Back-Up and Delete PDB Policy:

To upgrade the AKS cluster, you must have contributor access to your user.

Backup PDBs:
kubectl get pdb -A -o yaml > backup.yaml

Delete PDBs:
kubectl delete --all pdb -A

Check PDBs:
kubectl get pdb -A

  • Upgrade AKS Cluster:

Execute the following command to upgrade the AKS cluster:

az aks upgrade --resource-group <myResourceGroup> --name <myAKSCluster> --Kubernetes-version <KUBERNETES_VERSION>

Example:
az aks upgrade --resource-group stinsco1-ResGroup --name stinsco1-akscluster1-eastus --Kubernetes-version 1.28.9

  • Restore PDB Policy:

Restore PDBs:
kubectl apply -f backup.yaml

Check PDBs:
kubectl get pdb -A

  • Confirm Upgrade:

To confirm the successful upgrade, recheck the cluster configuration:
az aks show --resource-group <myResourceGroup> --name <myAKSCluster> --query kubernetesVersion

Or again check the cluster configuration from the Azure portal.

Related content

Application Health Check and Scheduled Maintenance
Application Health Check and Scheduled Maintenance
Read with this
Kubernetes Framework - AKS Cluster Upgrade Guide
Kubernetes Framework - AKS Cluster Upgrade Guide
More like this
AC Cloud DR & BCP Architecture & Design, Coverage, Processes, Tools
AC Cloud DR & BCP Architecture & Design, Coverage, Processes, Tools
Read with this
Kubernetes Configuration Upgrade
Kubernetes Configuration Upgrade
More like this
SunLife - Azure SFTP Design and Setup
SunLife - Azure SFTP Design and Setup
Read with this