kubectl get pods -n payments -o custom-columns=NAME:.metadata.name,PHASE:.status.phase,NODE:.spec.nodeName,IP:.status.podIPRender table output with selected fields.
Debugging, inspection, RBAC checks, rollout failures, node health, and maintenance-oriented kubectl workflows.
Query cluster state efficiently.
kubectl get pods -n payments -o custom-columns=NAME:.metadata.name,PHASE:.status.phase,NODE:.spec.nodeName,IP:.status.podIPRender table output with selected fields.
kubectl get deployment web -n payments -o jsonDump a resource as JSON.
kubectl get deployment web -n payments -o yamlDump a resource as YAML.
kubectl get pods -n payments --sort-by=.status.startTimeSort list output by a JSONPath-like field.
kubectl get pods -A --field-selector=status.phase!=RunningFilter server-side using field selectors.
kubectl get pods -n payments -l 'app=web,component=api'Filter resources using labels.
kubectl get pods -n payments --no-headersSuppress table headers for scripting.
kubectl get pods -n payments -o nameReturn resource identifiers only.
Interactive and ephemeral debugging workflows.
kubectl debug node/worker-02 -it --image=busybox:1.36Launch a debugging pod on a node.
kubectl debug web-abc123 -n payments --copy-to=web-debug --container=web -- shCreate a debug copy of a pod.
kubectl debug -it web-abc123 -n payments --image=nicolaka/netshoot --target=webInject an ephemeral debug container into a running pod.
kubectl auth can-i create deployments -n paymentsAsk the API server whether an action is allowed.
kubectl auth can-i get secrets -n payments --as=system:serviceaccount:payments:webTest RBAC from another subject's perspective.
kubectl get pod web-abc123 -n payments -o jsonpath='{range .status.conditions[*]}{.type}{"="}{.status}{"
"}{end}'Print pod condition states.
kubectl describe pods -n payments -l app=workerInspect all matching pods for failure clues.
Diagnose stuck updates and unschedulable pods.
kubectl get pods -A --field-selector=status.phase=PendingFind pods waiting to schedule or start.
kubectl describe pod pending-pod -n paymentsLook for failed scheduling and image pull events.
kubectl get nodes -o custom-columns=NAME:.metadata.name,READY:.status.conditions[?(@.type=="Ready")].status,MEMORYPRESSURE:.status.conditions[?(@.type=="MemoryPressure")].status,DISKPRESSURE:.status.conditions[?(@.type=="DiskPressure")].statusCheck high-level node health indicators.
kubectl rollout pause deployment/web -n paymentsTemporarily pause a deployment rollout.
kubectl rollout resume deployment/web -n paymentsResume a paused deployment rollout.
kubectl get pdb -AShow PodDisruptionBudgets.
kubectl describe pdb web -n paymentsInspect disruption constraints that may block eviction.
Bulk cleanup and namespace triage patterns.
kubectl get pods -A --field-selector=status.phase=Failed | grep Evicted | awk '{print $1, $2}'Pattern to find evicted pods for cleanup.
kubectl delete jobs -n ops --field-selector=status.successful=1Clean up successful Jobs when appropriate.
kubectl get namespace stuck-ns -o jsonpath='{.spec.finalizers}'See whether finalizers are blocking deletion.
kubectl get --raw='/healthz?verbose'Read API server health information.
kubectl get --raw='/readyz?verbose'Read API server readiness information.
Legacy command seen on older clusters; modern clusters rely on health endpoints and metrics.
kubectl get componentstatusesLegacy command seen on older clusters; modern clusters rely on health endpoints and metrics.