System design · 8 of 16
Mid
Senior
- Monitoring and alerting for 100 servicesSRE · Platform · DevOps
- Secrets management platformDevOps · Platform · SRE
- Multi-region active-active serviceSRE · Platform
- Distributed job scheduler (cron at scale)SRE · Platform
- Internal developer platform (IDP)Platform
- Multi-tenant Kubernetes platformPlatform · DevOps · SRE
- GitOps for a fleet of 100 clustersPlatform · DevOps
- ML training platform and feature storeMLOps · Platform
- LLM inference platformMLOps · Platform · SRE
SENIOR · 13 MIN · DEVOPS · PLATFORM · SRE
Secrets management platform
Workload identity instead of passwords, a highly available Vault, KMS auto-unseal, short-lived dynamic credentials and full audit logs.
- Peak load
- 200 reads/s, 5,000 logins in a restart
- Availability target
- 99.99%
- RTO: back up within
- 30 min
- RPO: data you can lose
- seconds (DR replica)
← Swipe sideways to see the whole diagram →
The question
"Design how 500 services and all CI pipelines get passwords, API keys and certificates without anyone storing secrets in Git or config files."
Requirements
- No long-lived secrets in code, images or CI variables if it can be avoided.
- Every secret access is authenticated, authorized and logged.
- Rotate secrets without redeploying, and revoke them fast after a leak.
- Highly available: if secrets are unavailable, apps can't start.
How it works
- A workload proves who it is without a password: a Kubernetes ServiceAccount token, a cloud IAM role, or a CI OIDC token.
- It logs in to the secrets service (HashiCorp Vault, or a cloud secret manager), which checks the identity and a policy ("the payments app may read
secret/payments/*"). - Vault returns a short-lived secret. For databases it can create a dynamic user that expires after, say, one hour.
- Vault's storage is encrypted; its root key is protected by a cloud KMS or HSM (auto-unseal), so no human has to type unseal keys after a restart.
- Every request goes to an audit log shipped to the SIEM.
- For apps that only read files or environment variables, the External Secrets Operator syncs secrets into Kubernetes Secrets (encrypted at rest).
Key decisions
| Decision | Choice | Why |
|---|---|---|
| Authentication | workload identity / OIDC | no "secret zero" to protect |
| Secret lifetime | short TTLs, dynamic credentials | a leaked credential expires on its own |
| Delivery | sidecar/agent files or synced K8s Secrets | apps don't need Vault code |
| HA | 3-5 node Raft cluster across zones, DR replica | secrets are on the startup path |
| Break-glass | sealed emergency access with alerts | humans can recover in a disaster, visibly |
What breaks and how it heals
- Vault unreachable: apps that already started keep working; cache leases and set TTLs long enough to ride out short outages.
- A secret leaks: revoke the lease or rotate the static secret, find who accessed it in audit logs, and fix how it leaked.
- Too many apps hitting Vault at startup: caching agents, and rate-limit friendly retries.
Load and capacity
| Item | Assumption | Result |
|---|---|---|
| Workloads | 500 services × 10 pods | 5,000 pods |
| Cluster restart | all 5,000 pods log in within 5 minutes | ~17 logins/s: easy for Vault |
| Steady reads | leases renewed every 30 min plus app reads | ~200 requests/s |
| Dynamic DB users | 1-hour TTL, renewed while the pod lives | thousands of short-lived users per day, cleaned up automatically |
High availability and disaster recovery
| Target | Number | How it is met |
|---|---|---|
| Availability | 99.99% (apps can't start without secrets) | 5-node Raft cluster across 3 AZs: survives 2 nodes failing |
| Leader node fails | ~10 s pause | a new leader is elected automatically; clients retry |
| Region fails | RTO 30 min, RPO seconds | a DR replica cluster in a second region (or Raft snapshots every hour to encrypted S3: RPO 1 hour) |
| Unseal after a full restart | no humans needed | auto-unseal with a multi-region cloud KMS key |
| Recovery keys | 5 holders, any 3 needed | Shamir key sharing, stored offline |
What interviewers listen for
- Identity-based access instead of shared passwords, and the "secret zero" problem.
- Dynamic, short-lived credentials and rotation.
- Availability and audit, plus what Kubernetes Secrets do and don't protect.