Video in progress

The prod Kubernetes cluster is completely gone (a region outage, or a mistaken terraform destroy). What is your plan to restore the services, and how do you prepare for it in advance?

The plan starts with RPO/RTO: the stateless part comes up in a new cluster from the manifests in Git (GitOps), and the stateful part is restored from a backup or replica outside the cluster. Most important is practice: a backup that has never been restored is not a backup.

📖 Answer

First you agree on two numbers with the business: RPO (how much data we accept losing) and RTO (how fast we must be back). They determine the architecture: an RTO of 4 hours is fine with a cold standby, an RTO of 5 minutes needs a cluster that is always running in another region.

The recovery layers:

  1. The cluster itself, with Terraform or Cluster API, as code: node pools, the ingress controller, cert-manager, External Secrets, monitoring, all with one pipeline.
  2. Applications: the GitOps repo is the source of truth. You install Argo CD on the new cluster and point it at that repo, with images in the registry referenced by digest. If the registry was in the same region, it is lost too, so you need registry replication.
  3. Secrets: keep Vault or the cloud secret manager independent of the cluster and the region. If you use Sealed Secrets, back up the controller's encryption key separately. Without it, every secret in Git becomes unreadable.
  4. Data is the hardest. Cross-region replicas or snapshots of the managed DB, MirrorMaker 2 for Kafka, object storage replication. Velero for PVCs inside the cluster, but keep its backup in another region too.
  5. External links: pointing DNS at the new ingress (with a small TTL set beforehand), IPs on partners' allowlists, webhook URLs, certificates.

Things that are often forgotten: CRDs and operators installed by hand rather than from Git; a ConfigMap that someone added with kubectl apply and that never made it into Git; the restore order, DB and secrets first and services after, otherwise everything just cycles in CrashLoopBackOff.

Practice: once a quarter, a "game day": a full restore into an empty cluster, with the time measured. The first drill usually takes several times longer than the agreed RTO, and that is exactly why you practice. Reading the runbook for the first time during an incident is the worst option.