Skip to content

Instantly share code, notes, and snippets.

@amandadebler
Created February 13, 2019 08:31
Show Gist options
  • Save amandadebler/bd1ba7e4a102dba2c2870c190364f7fe to your computer and use it in GitHub Desktop.
Save amandadebler/bd1ba7e4a102dba2c2870c190364f7fe to your computer and use it in GitHub Desktop.
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