View last applied configuration kubectl
Show the last-applied-configuration annotation; diff intent vs live state
kubectl apply view-last-applied deploy/<name> -n <ns> -o yaml
more kubectl
all 73 commands →
Warning events across all namespaces
kubectl get events -A --field-selector type=Warning --sort-by=.lastTimestamp
Find all failed pods cluster-wide
kubectl get pods -A --field-selector status.phase=Failed
Wait on a jsonpath condition
kubectl wait --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' svc/<name> -n <ns> --timeout=120s
Impersonate a user and group
kubectl auth can-i list secrets -n <ns> --as=<name> --as-group=system:serviceaccounts
Sort pods by container restart count
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.status.containerStatuses[0].restartCount}{"\n"}{end}' | sort -k3 -rn | head