Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reports the Docker runtime version for all nodes in all AKS clusters in all subscriptions in an Azure tenant
$mySubscriptions = $(az account list --query [].id -o tsv)
foreach ($subscription in $mySubscriptions) {
$clusters = $(az aks list --subscription $subscription) | ConvertFrom-Json
foreach ($cluster in $clusters) {
"$($cluster.name) in resource group $($cluster.resourceGroup) in subscription $subscription"
az aks get-credentials --resource-group $($cluster.resourceGroup) --name $($cluster.name) --subscription $subscription --overwrite-existing
kubectl get nodes -o custom-columns=NAME:.metadata.name,VERSION:.status.nodeInfo.containerRuntimeVersion
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment