View last applied configuration
Show the last-applied-configuration annotation; diff intent vs live state
kubectl apply view-last-applied deploy/<name> -n <ns> -o yaml
- tool
- kubectl73 commands
More kubectl commands
-
kubectl get events -A --field-selector type=Warning --sort-by=.lastTimestampCluster-wide Warning events newest last; fast triage of failing workloads
-
kubectl get pods -A --field-selector status.phase=FailedList pods in Failed phase across namespaces for cleanup or investigation
-
kubectl wait --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' svc/<name> -n <ns> --timeout=120sBlock in CI until a Service gets its external IP; works on any jsonpath field
-
kubectl auth can-i list secrets -n <ns> --as=<name> --as-group=system:serviceaccountsTest RBAC as another identity without their kubeconfig; needs impersonate verb
-
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.status.containerStatuses[0].restartCount}{"\n"}{end}' | sort -k3 -rn | headSurface the most-restarting pods to catch crashloops fast