Home How to Upgrade Your Azure AKS Cluster Like a Pro
Post
Cancel

How to Upgrade Your Azure AKS Cluster Like a Pro

How to Upgrade Your Azure AKS Cluster Like a Pro

Alright, folks, today we’re diving into the world of Kubernetes upgrades. If you’re running an Azure Kubernetes Service (AKS) cluster, you know that keeping it up-to-date is like maintaining a high-performance car. You don’t want to skip those upgrades, or you’ll be left in the dust with outdated features and potential security risks. So, grab your coffee, and let’s get this done.


Step 1: Check Your Application Gateway

Before we even touch the cluster, let’s make sure your Application Gateway is in good shape. Run this command to check its status:

1
az network application-gateway show --resource-group <your-resource-group> --name <your-app-gateway-name>

Want to know the SKU of your Application Gateway? No problem:

1
az network application-gateway show --resource-group <your-resource-group> --name <your-app-gateway-name> --query "sku"

This is like checking your tires before a road trip. You don’t want surprises halfway through.

Step 2: Enable the Ingress Add-On

If you’re using an Application Gateway as your ingress controller, you’ll need to enable the add-on. Here’s how you do it:

1
az aks enable-addons --resource-group <your-resource-group> --name <your-cluster-name> --addons ingress-appgw --appgw-id <your-app-gateway-id>

This step is crucial. Think of it as setting up the GPS for your Kubernetes traffic.

Step 3: Upgrade the Cluster

Now, the main event: upgrading your AKS cluster. First, pick the Kubernetes version you want to upgrade to. For this example, we’re going with 1.29.9. Run the following command:

1
az aks upgrade --resource-group <your-resource-group> --name <your-cluster-name> --kubernetes-version 1.29.9

Boom. Your cluster is now upgrading. But wait, don’t just walk away. You need to check the provisioning state to make sure everything is running smoothly:

1
az aks show --resource-group <your-resource-group> --name <your-cluster-name> --query 'provisioningState'

If it says Succeeded, you’re golden. If not, well, time to troubleshoot.

Step 4: Rinse and Repeat for All Clusters

If you’re managing multiple clusters (and let’s be honest, who isn’t?), you’ll need to repeat this process for each one. Here’s a quick example:

1
2
az aks upgrade --resource-group <staging-resource-group> --name <staging-cluster-name> --kubernetes-version 1.29.9
az aks show --resource-group <staging-resource-group> --name <staging-cluster-name> --query 'provisioningState'

And for production:

1
2
az aks upgrade --resource-group <prod-resource-group> --name <prod-cluster-name> --kubernetes-version 1.29.9
az aks show --resource-group <prod-resource-group> --name <prod-cluster-name> --query 'provisioningState'

It’s like upgrading your fleet of cars. Each one needs attention, but the process is the same.

Step 5: Celebrate

Once all your clusters are upgraded, take a moment to appreciate your work. You’ve just ensured your infrastructure is running the latest and greatest Kubernetes version. That’s no small feat.

Final Thoughts

Upgrading an AKS cluster might seem daunting, but it’s all about breaking it down into manageable steps. Check your setup, enable the right add-ons, and upgrade with confidence. And remember, always keep an eye on the provisioning state to catch any issues early.

Now go out there and crush it. Your Kubernetes clusters are counting on you.

This post is licensed under CC BY 4.0 by the author.