Check what's in a ConfigMap
Print just the data field; pipe to python -m json.tool for formatting
kubectl get cm <name> -n <ns> -o jsonpath='{.data}'
- tool
- k8s-debug27 commands
More k8s-debug commands
-
kubectl get secret <name> -n <ns> -o jsonpath='{.data}' | python3 -c "import sys,json,base64; [print(k,'=',base64.b64decode(v).decode()) for k,v in json.load(sys.stdin).items()]"Dump and base64-decode all fields in a k8s Secret
-
kubectl api-resources --verbs=list --namespaced -o name | xargs -I{} kubectl get {} -n <ns> --ignore-not-foundEnumerate every resource type in a namespace — useful for auditing
-
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}\t{.metadata.name}\t{.status.phase}\n{end}'Extract specific fields from k8s API objects without jq
-
kubectl debug -it mypod --image=busybox --target=appAttach an ephemeral debug container to a running pod
-
kubectl debug node/my-node -it --image=ubuntuGet privileged shell on a cluster node via debug pod