Interview Prep/SRE & Reliability/Best Practices & Rapid-Fire Commands

Rapid-fire: commands to check service health quickly during an incident on Kubernetes.

IntermediateConceptBest Practices & Rapid-Fire Commands
Answer
kubectl rollout history deploy/checkout -n shop
kubectl rollout undo deploy/checkout -n shop            # fastest mitigation after a bad deploy
kubectl rollout status deploy/checkout -n shop
kubectl get events -n shop --sort-by=.lastTimestamp | tail -20
kubectl top pods -n shop --sort-by=cpu
kubectl get endpointslices -n shop -l kubernetes.io/service-name=checkout
kubectl scale deploy/checkout -n shop --replicas=10
kubectl argo rollouts abort checkout -n shop            # abort a canary
All SRE & Reliability questions

More on Best Practices & Rapid-Fire Commands