Skip to content

Instantly share code, notes, and snippets.

@MartinLuksik
Last active August 16, 2022 09:57
Show Gist options
  • Save MartinLuksik/d3ad052d43a04ea003d358f3ff026d1e to your computer and use it in GitHub Desktop.
Save MartinLuksik/d3ad052d43a04ea003d358f3ff026d1e to your computer and use it in GitHub Desktop.
[AKS] AKS #aks #azure #k8s
## get available versions
az aks get-versions --location switzerland-north --output table
## check for cluster used APIs and compare with a deprication guide (https://kubernetes.io/docs/reference/using-api/deprecation-guide)
kubectl api-resources -n all
# fetch credentials for admin into a file and merge existing
az aks get-credentials --resource-group $RSG_NAME --name $AKS_NAME --admin --file ./.kube/config --overwrite-existing
// List container logs per namespace
// View container logs from all the namespaces in the cluster.
ContainerLog
| join(
KubePodInventory
| where Namespace == "acrmanager"
| distinct ContainerID
)//KubePodInventory Contains namespace information
on ContainerID
| project TimeGenerated, ContainerID, LogEntrySource, LogEntry
KubePodInventory
| where Namespace == "acrmanager"
| where ClusterName == "t-sn-01-aks"
| where ContainerName has "acrmanager"
| distinct ContainerID, ContainerName, PodCreationTimeStamp
| project ContainerID, ContainerName, PodCreationTimeStamp
ContainerLog
| where ContainerID == "d61ef82c43cb3cb11572726f7dfde40ca8df414a14a0b59184e22e7dd4478064"
//| where LogEntry has "Conflict"
| project TimeGenerated, LogEntry
# Depricated K8s APIS:
https://cloud.google.com/kubernetes-engine/docs/deprecations/apis-1-22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment