Decode one key in a secret
kubectl get secret <name> -o jsonpath='{.data.<key>}' | base64 -dThe value lands in your terminal and its scrollback — not while screen sharing. macOS before Ventura spells it -D.
kubectl commands that each do one job. Copy one straight from this page — the
note under each says what it changes before you point it at a cluster.
kubectl get secret <name> -o jsonpath='{.data.<key>}' | base64 -dThe value lands in your terminal and its scrollback — not while screen sharing. macOS before Ventura spells it -D.
kubectl get secret <name> -o go-template='{{range $k, $v := .data}}{{$k}}: {{$v | base64decode}}{{"\n"}}{{end}}'One line per key, when you don't know what the secret holds.
kubectl get secret <name> -o jsonpath='{.data.tls\.crt}' | base64 -dJSONPath reads a dot as a separator, so tls.crt has to be escaped.
kubectl config set-context --current --namespace=<namespace>Stored in the kubeconfig, so every terminal on that context follows. A typo is accepted and later commands just find nothing.
kubectl config view --minify -o jsonpath='{..namespace}'Prints nothing when the context sets none, which means default.
kubectl delete pods -A --field-selector=status.phase=FailedClears the Evicted rows left by node pressure. Their logs go too, so save anything you still need.
kubectl get pods -A --field-selector=status.phase=FailedWhat the delete would take. CrashLoopBackOff pods are Running, not Failed, so they stay.
kubectl logs -f deploy/api --all-containersFollows the deployment's pods together, sidecars included.