Skip to content

Instantly share code, notes, and snippets.

@visualdensity
Last active February 9, 2022 22:32
Show Gist options
  • Save visualdensity/3f040e32ce9cdeb02f700e2599f8ea1b to your computer and use it in GitHub Desktop.
Save visualdensity/3f040e32ce9cdeb02f700e2599f8ea1b to your computer and use it in GitHub Desktop.

AKS

Azure AKS Get Credentials

az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

Getting each deployment and exract its image used:

kubectl get deployments -n backend -o=jsonpath='{range .items[*]}{.metadata.name}{", "}{.spec.template.spec.containers[].image}{"\n"}'

Output will be in the following format:

{deployment_name}, {deployed_image}

If you need just the image used:

kubectl get deployments -n backend -o=jsonpath='{range .items[*]}{.spec.template.spec.containers[].image}{"\n"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment