JSONPath on any resource
Extract specific fields from k8s API objects without jq
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}\t{.metadata.name}\t{.status.phase}\n{end}'
- tool
- k8s-debug27 commands
More k8s-debug commands
-
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
-
kubectl exec -it mypod -c sidecar-name -- /bin/shOpen shell in a specific container of a multi-container pod
-
kubectl get pod mypod -o jsonpath='{range .spec.containers[*]}{.name}{"\t"}{.resources}{"\n"}{end}'Show resource requests and limits for each container
-
kubectl describe node my-node | grep -A5 'Conditions:'Check node conditions: Ready, MemoryPressure, DiskPressure