上一篇介紹自動擴充時有遇到 Client 版本和 Server 版本不匹配的狀況, 導致 CPU 監控的功能無法使用, 本篇筆記將介紹如何將 AKS 升級到新版本
(部分資訊將會遮罩)
-g 15maksrg -n 15makscls
列出目前 resource group 的 aks 叢集資訊, 其中 kubernetesVersion
為目前配置的 AKS 版本PS C:\WINDOWS\system32> az aks list
[
{
<略…>
"id": "/subscriptions/11e5233d-dbe1-4167-ac91-????????????/resourcegroups/15maksrg/providers/Microsoft.ContainerService/managedClusters/15makscls",
"kubernetesVersion": "1.10.8",
<略…>
}
]
get-versions -l southeastasia
列出 data center 可用的 kubernetes 版本, 其中 -l
是 location
參數, 以本例是 southeastasia data centerPS C:\WINDOWS\system32> az aks get-versions -l southeastasia
{
"id": "/subscriptions/11e5233d-dbe1-4167-ac91-????????????/providers/Microsoft.ContainerService/locations/southeastasia/orchestrators",
"name": "default",
"orchestrators": [
{
"default": null,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.7.15",
"upgrades": [
{
"orchestratorType": null,
"orchestratorVersion": "1.7.16"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.8.14"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.8.15"
}
]
},
{
"default": null,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.7.16",
"upgrades": [
{
"orchestratorType": null,
"orchestratorVersion": "1.8.14"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.8.15"
}
]
},
{
"default": null,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.8.14",
"upgrades": [
{
"orchestratorType": null,
"orchestratorVersion": "1.8.15"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.9.10"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.9.11"
}
]
},
{
"default": null,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.8.15",
"upgrades": [
{
"orchestratorType": null,
"orchestratorVersion": "1.9.10"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.9.11"
}
]
},
{
"default": null,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.9.10",
"upgrades": [
{
"orchestratorType": null,
"orchestratorVersion": "1.9.11"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.10.7"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.10.8"
}
]
},
{
"default": null,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.9.11",
"upgrades": [
{
"orchestratorType": null,
"orchestratorVersion": "1.10.7"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.10.8"
}
]
},
{
"default": null,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.10.7",
"upgrades": [
{
"orchestratorType": null,
"orchestratorVersion": "1.10.8"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.11.2"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.11.3"
}
]
},
{
"default": true,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.10.8",
"upgrades": [
{
"orchestratorType": null,
"orchestratorVersion": "1.11.2"
},
{
"orchestratorType": null,
"orchestratorVersion": "1.11.3"
}
]
},
{
"default": null,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.11.2",
"upgrades": [
{
"orchestratorType": null,
"orchestratorVersion": "1.11.3"
}
]
},
{
"default": null,
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.11.3",
"upgrades": null
}
],
"type": "Microsoft.ContainerService/locations/orchestrators"
}
由上述的可用版本清單, 最新的版本為 1.11.3 版, 版本升級時需要漸進式的升級, 例如 1.9.x 不能直接升級到 1.11.x 版本, 需要先升級到 1.10.8 後才能升級到 1.11.3
4. 使用命令 az aks upgrade
-g 15maksrg -n 15makscluster -k "1.11.3" 將 aks 升級到 1.11.3 版本
PS C:\WINDOWS\system32> az aks upgrade -g 15maksrg -n 15makscls -k "1.11.3"
Kubernetes may be unavailable during cluster upgrades.
Are you sure you want to perform this operation? (y/n): y
{
<略…>
"id": "/subscriptions/11e5233d-dbe1-4167-ac91-????????????/resourcegroups/15maksrg/providers/Microsoft.ContainerService/managedClusters/15makscls",
"kubernetesVersion": "1.11.3",
<略…>
}
{
<略…>
"id": "/subscriptions/11e5233d-dbe1-4167-ac91-????????????/resourcegroups/15maksrg/providers/Microsoft.ContainerService/managedClusters/15makscls",
"kubernetesVersion": "1.11.3",
<略…>
}
是不是很簡單就能夠升級 AKS 囉?