Dump all pod YAML to file kubectl
Backup/inspect entire pod state in a namespace
kubectl get pods -n <ns> -o yaml > pods-dump.yaml
more kubectl
all 73 commands →
Jsonpath — all container images
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{range .spec.containers[*]}{.image}{"\n"}{end}{end}'
Switch kubeconfig context
kubectl config use-context <context>
List kubeconfig contexts
kubectl config get-contexts
Merge kubeconfigs
KUBECONFIG=~/.kube/config:~/.kube/cluster2.yaml kubectl config view --flatten > ~/.kube/merged.yaml
Set default namespace for context
kubectl config set-context --current --namespace=<ns>