How do you list everything running in a namespace and see what is unhealthy?
BeginnerScenarioUpgrades, etcd, disaster recovery and incidents
Answer
Situation read → You are handed an unfamiliar namespace during an incident.
What I'd do →
kubectl get all -n appfor the main workload objectskubectl get pods -n app -o wideto see nodes and restartskubectl get events -n app --sort-by=.lastTimestampkubectl top pods -n appfor resource usagekubectl describeon anything not Running or Ready
Why → A few commands give you state, placement, events and usage within a minute.
Interview tip → Note that get all does not include ConfigMaps, Secrets, Ingress or PVCs.
More on Upgrades, etcd, disaster recovery and incidents
How do you back up etcd on a self-managed cluster?BeginnerHow do you restore a cluster from an etcd snapshot?Advancedetcd database space exceeded: `mvcc: database space exceeded`. What now?AdvancedWalk through a kubeadm minor version upgrade.AdvancedHow do you find deprecated or removed APIs before an upgrade?IntermediateA cluster upgrade broke an operator because its CRD API version was removed. How do you recover?Advanced