Decode a Secret k8s-debug
Dump and base64-decode all fields in a k8s Secret
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()]"
more k8s-debug
all 27 commands →
List all resources in namespace
kubectl api-resources --verbs=list --namespaced -o name | xargs -I{} kubectl get {} -n <ns> --ignore-not-found
JSONPath on any resource
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}\t{.metadata.name}\t{.status.phase}\n{end}'
Debug pod with ephemeral container
kubectl debug -it mypod --image=busybox --target=app
Run debug pod on node
kubectl debug node/my-node -it --image=ubuntu
Exec into sidecar container
kubectl exec -it mypod -c sidecar-name -- /bin/sh