Interview Prep/Kubernetes/Upgrades, etcd, disaster recovery and incidents

How do you stop and start a workload for the night without deleting it?

BeginnerScenarioUpgrades, etcd, disaster recovery and incidents
Answer

Situation read → A dev environment costs money overnight.

What I'd do →

  1. kubectl scale deploy --all --replicas=0 -n dev
  2. Record the original counts first (kubectl get deploy -n dev -o custom-columns=NAME:.metadata.name,REPLICAS:.spec.replicas)
  3. Scale back up in the morning
  4. Automate with a CronJob and a scoped ServiceAccount, or KEDA cron scaler
  5. Keep PVCs, which are not deleted by scaling

Why → Scaling to zero keeps all objects and data while releasing compute.

Interview tip → Mention that GitOps will undo manual scaling unless paused.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Upgrades, etcd, disaster recovery and incidents