Skip to content

Latest commit

 

History

History
149 lines (120 loc) · 4.76 KB

tutorial-kubernetes-upgrade-cluster.md

File metadata and controls

149 lines (120 loc) · 4.76 KB

title: Kubernetes on Azure tutorial - update cluster | Microsoft Docs description: Kubernetes on Azure tutorial - update cluster services: container-service documentationcenter: '' author: neilpeterson manager: timlt editor: '' tags: aks, azure-container-service keywords: Docker, Containers, Micro-services, Kubernetes, DC/OS, Azure

ms.assetid: ms.service: container-service ms.devlang: aurecli ms.topic: tutorial ms.tgt_pltfrm: na ms.workload: na ms.date: 11/15/2017 ms.author: nepeters ms.custom: mvc

Upgrade Kubernetes in Azure Container Service (AKS)

An Azure Container Service (AKS) cluster can be upgraded using the Azure CLI. During the upgrade process, Kubernetes nodes are carefully cordoned and drained to minimize disruption to running applications.

In this tutorial, part eight of eight, a Kubernetes cluster is upgraded. Tasks that you complete include:

[!div class="checklist"]

  • Identify current and available Kubernetes versions
  • Upgrade the Kubernetes nodes
  • Validate a successful upgrade

Before you begin

In previous tutorials, an application was packaged into a container image, this image uploaded to Azure Container Registry, and a Kubernetes cluster created. The application was then run on the Kubernetes cluster.

If you have not done these steps, and would like to follow along, return to the Tutorial 1 – Create container images.

Get cluster versions

Before upgrading a cluster, use the az aks get-versions command to check which Kubernetes releases are available for upgrade.

az aks get-versions --name myK8sCluster --resource-group myResourceGroup --output table

Here you can see that the current node version is 1.7.7 and that version 1.7.9, 1.8.1, and 1.8.2 are available.

Name     ResourceGroup    MasterVersion    MasterUpgrades       NodePoolVersion     NodePoolUpgrades
-------  ---------------  ---------------  -------------------  ------------------  -------------------
default  myAKSCluster     1.7.7            1.8.2, 1.7.9, 1.8.1  1.7.7               1.8.2, 1.7.9, 1.8.1

Upgrade cluster

Use the az aks upgrade command to upgrade the cluster nodes. The following examples updates the cluster to version 1.8.2.

az aks upgrade --name myK8sCluster --resource-group myResourceGroup --kubernetes-version 1.8.2

Output:

{
  "id": "/subscriptions/4f48eeae-9347-40c5-897b-46af1b8811ec/resourcegroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myK8sCluster",
  "location": "eastus",
  "name": "myK8sCluster",
  "properties": {
    "accessProfiles": {
      "clusterAdmin": {
        "kubeConfig": "..."
      },
      "clusterUser": {
        "kubeConfig": "..."
      }
    },
    "agentPoolProfiles": [
      {
        "count": 1,
        "dnsPrefix": null,
        "fqdn": null,
        "name": "myK8sCluster",
        "osDiskSizeGb": null,
        "osType": "Linux",
        "ports": null,
        "storageProfile": "ManagedDisks",
        "vmSize": "Standard_D2_v2",
        "vnetSubnetId": null
      }
    ],
    "dnsPrefix": "myK8sClust-myResourceGroup-4f48ee",
    "fqdn": "myk8sclust-myresourcegroup-4f48ee-406cc140.hcp.eastus.azmk8s.io",
    "kubernetesVersion": "1.8.2",
    "linuxProfile": {
      "adminUsername": "azureuser",
      "ssh": {
        "publicKeys": [
          {
            "keyData": "..."
          }
        ]
      }
    },
    "provisioningState": "Succeeded",
    "servicePrincipalProfile": {
      "clientId": "e70c1c1c-0ca4-4e0a-be5e-aea5225af017",
      "keyVaultSecretRef": null,
      "secret": null
    }
  },
  "resourceGroup": "myResourceGroup",
  "tags": null,
  "type": "Microsoft.ContainerService/ManagedClusters"
}

Validate upgrade

You can now confirm the upgrade was successful with the az aks show command.

az aks show --name myK8sCluster --resource-group myResourceGroup --output table

Output:

Name          Location    ResourceGroup    KubernetesVersion    ProvisioningState    Fqdn
------------  ----------  ---------------  -------------------  -------------------  ----------------------------------------------------------------
myK8sCluster  eastus     myResourceGroup  1.8.2                Succeeded            myk8sclust-myresourcegroup-3762d8-2f6ca801.hcp.eastus.azmk8s.io

Next steps

In this tutorial, you upgraded Kubernetes in an AKS cluster. The following tasks were completed:

[!div class="checklist"]

  • Identify current and available Kubernetes versions
  • Upgrade the Kubernetes nodes
  • Validate a successful upgrade

Follow this link to learn more about AKS.

[!div class="nextstepaction"] AKS overview