Interview Prep/Kubernetes/Configuration, Secrets and storage

How do you take backups and restore stateful workloads on Kubernetes?

AdvancedScenarioConfiguration, Secrets and storage
Answer

Situation read → The business needs RPO below 1 hour for a database on Kubernetes.

What I'd do →

  1. Use database-native backups (pg_dump, pgBackRest, WAL archiving to S3) as the primary method
  2. Use CSI VolumeSnapshots for crash-consistent snapshots with a VolumeSnapshotClass
  3. Use Velero for namespace-level backups of objects and PV snapshots
  4. Test restores regularly into a scratch cluster
  5. Store backups in a separate account and region

Why → Snapshots alone can be inconsistent for databases, and untested backups are not backups.

Interview tip → Mention an operator such as CloudNativePG which automates this.

All Kubernetes questions Roadmap: Kubernetes core

More on Configuration, Secrets and storage