Table of Contents
Azure Kubernetes Service (AKS) is a managed container orchestration service, which simplifies Kubernetes management, deployment, and operations. As an Azure administrator preparing for the AZ-104 exam, understanding how to upgrade an AKS cluster is crucial. Upgrading an AKS cluster ensures that you have the latest features, security updates, and performance improvements.
Before performing an upgrade, you should:
az aks show --resource-group myResourceGroup --name myAKSCluster --output table
az aks get-upgrades --resource-group myResourceGroup --name myAKSCluster --output table
az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version
Here is an example of upgrading an AKS cluster to Kubernetes version 1.20.6:
az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version 1.20.6
az aks show --resource-group myResourceGroup --name myAKSCluster --output table
While the upgrade is taking place, AKS performs a cordon and drain process on the nodes, ensuring that the workloads are safely moved to other nodes before upgrading the underlying VM. You can monitor the status of the nodes by using the following command:
kubectl get nodes -o wide
AKS allows you to also manage and upgrade the node pools separately. Here are the commands to upgrade node pools:
az aks nodepool list --resource-group myResourceGroup --cluster-name myAKSCluster --output table
az aks nodepool upgrade --resource-group myResourceGroup --cluster-name myAKSCluster --name myNodePool --kubernetes-version
AKS makes cluster management and upgrades a streamlined process compared to manual Kubernetes upgrades. It is essential for administrators to stay informed about the upgrade strategies and leverage Azure’s native tools to maintain their clusters effectively. Following the upgrade guidelines will help to ensure that your AKS clusters remain secure, performant, and feature-rich.
Answer: A) True
Explanation: AKS clusters can be manually upgraded using the Azure CLI or portal, or set to automatically upgrade when a new Kubernetes version is available.
Answer: B) False
Explanation: During an AKS cluster upgrade, nodes are upgraded one at a time to ensure that the workloads remain available.
Answer: A) True
Explanation: Reviewing the release notes for the target Kubernetes version is essential as it helps you understand the changes, new features, deprecations, or any important upgrade notes.
Answer: A) az aks upgrade
Explanation: The ‘az aks upgrade’ command is used to upgrade the Kubernetes version of an AKS cluster.
Answer: D) Network plugin
Explanation: The network plugin (Azure CNI or kubenet) cannot be changed after an AKS cluster is created. You must choose the appropriate network plugin at the time of cluster creation.
Answer: B) Yes, without interruptions
Explanation: If performed correctly, a rolling update in a multi-node cluster allows applications to remain available as nodes are upgraded one at a time.
Answer: B) False
Explanation: Azure does not automatically take a snapshot of AKS nodes before an upgrade. Users are responsible for any necessary backup before performing the upgrade.
Answer: C) Under the “Settings” section, then “Upgrade”
Explanation: In the Azure Portal, the option to upgrade the AKS cluster is found under the “Settings” section by clicking on “Upgrade”.
Answer: B) No, kubelet is updated automatically during the upgrade process
Explanation: The kubelet and other Kubernetes components on the nodes are automatically updated as part of the AKS cluster upgrade process.
Answer: B) False
Explanation: AKS does not support skipping minor versions during an upgrade. You must upgrade to each minor version sequentially.
Answer: B) To update the underlying operating system and runtime components of the agent nodes
Explanation: A node image upgrade updates the OS image and runtime components of the AKS nodes but does not change the Kubernetes version.
Answer: B) No, the upgrade process does not have an SLA from Azure
Explanation: Microsoft does not provide an SLA for the AKS cluster upgrade process. It is recommended to plan and test upgrades carefully to minimize disruptions.
AKS is a fully managed Kubernetes service provided by Microsoft Azure that enables you to deploy and manage containerized applications. It is important to upgrade an AKS cluster to keep it up to date with the latest features, bug fixes, and security updates.
The two main approaches to upgrading an AKS cluster are control plane upgrades and node upgrades.
A control plane upgrade involves upgrading the Kubernetes version of the AKS cluster’s API server, controller manager, and etcd. Control plane upgrades are managed by Azure, which means that you don’t need to manually upgrade the control plane.
A node upgrade involves upgrading the Kubernetes version of the worker nodes in the AKS cluster. Node upgrades are not managed by Azure, which means that you need to manually upgrade the nodes.
You can check if a new control plane version is available for your AKS cluster by running the “az aks get-upgrades” command.
You can upgrade the control plane of an AKS cluster by running the “az aks upgrade” command.
You can check if a new node version is available for your AKS cluster by running the “az aks get-upgrades” command.
The two approaches to upgrading the nodes in an AKS cluster are manually upgrading each node and using the AKS Upgrade Wizard.
The AKS Upgrade Wizard is a tool that automates the process of upgrading the nodes in an AKS cluster. It allows you to upgrade multiple nodes simultaneously.
You can manually upgrade each node in an AKS cluster by creating a new node pool with the updated Kubernetes version and migrating workloads to the new node pool.
If this material is helpful, please leave a comment and support us to continue.