Jsonpath — all container images

Enumerate every container image running in the cluster

kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{range .spec.containers[*]}{.image}{"\n"}{end}{end}'

tool
kubectl73 commands
tags
debugpods

More kubectl commands

  • kubectl config use-context <context>

    Switch the active cluster context

  • kubectl config get-contexts

    Show all contexts in current kubeconfig

  • KUBECONFIG=~/.kube/config:~/.kube/cluster2.yaml kubectl config view --flatten > ~/.kube/merged.yaml

    Combine multiple kubeconfig files into one

  • kubectl config set-context --current --namespace=<ns>

    Avoid typing -n on every command for this context

  • kubectl cluster-info

    Show API server and CoreDNS endpoints

all 73 kubectl commands