Encrypting Secrets at Rest in etcd with KMS Providers
Configure encryptionConfiguration with KMS providers for secrets at rest.
In plain words
etcd stores a locked parcel and KMS holds the parcel key; losing the key service makes the parcel unreadable even though it remains present. The simple Kubernetes rule is: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
Think of it like…
etcd stores a locked parcel and KMS holds the parcel key; losing the key service makes the parcel unreadable even though it remains present.
Where you’ve seen it
During an access review, the security engineer runs kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings. Expected evidence: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database. If the run instead shows this symptom, stop and restore the last known state: An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration.
Words you’ll hear
- KMS
- For this lesson, KMS is the controlling idea: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
- EncryptionConfig
- EncryptionConfig is the checkpoint; run
kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | stringsand inspect the owner chain. An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration. - etcd
- etcd is the outcome to preserve; the cost is explicit: KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path.
- Verification evidence
- The evidence command is
kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings. It connects the declaration to this behavior: Configure encryptionConfiguration with KMS providers for secrets at rest.
Visual diagram
Theory & deep dive
How KMS reaches the intended state
Configure encryptionConfiguration with KMS providers for secrets at rest. EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
The concrete checkpoint is kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings; compare the KMS owner, EncryptionConfig state, and etcd outcome instead of treating YAML acceptance as proof.
Run kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings after the change and correlate the result with Events and the owning object. EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
EncryptionConfig: failure boundary and production cost
An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration. The prerequisite contract is concrete: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path. A safe design limits blast radius, records the last good configuration, and uses kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings as a deterministic rollback checkpoint.
Capture the current state with kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration.
How it works, step by step
Step 1 of 41. Model the trust boundary
Name the identity, action, resource, and trust boundary before choosing a control: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
- Goal
- Configure encryptionConfiguration with KMS providers for secrets at rest.
- Owner
- KMS
When to use it & trade-offs
What it is
Configure encryptionConfiguration with KMS providers for secrets at rest. EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
Why it matters: An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration. The invariant at risk is specific: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database. The quickest fact check before changing the design is kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings.
When to reach for it
- Use KMS to enforce this invariant: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
- Use EncryptionConfig evidence from
kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | stringsin reviews and incident timelines. Configure encryptionConfiguration with KMS providers for secrets at rest. - Choose the hosted security service route only when this cost is justified by governance or scale: KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path.
When to avoid or be careful
- Avoid assuming KMS is complete after YAML submission; the required behavior is concrete: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | stringsfirst: An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration. - Avoid adopting a heavier platform wrapper before measuring its cost: KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path.
Native, manual, and managed paths for KMS
kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings.Strengths: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
Watch out: KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path. Recovery must also recognize this signal: An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration.
kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings; the expected invariant is: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.Strengths: kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike KMS, it does not make this symptom self-documenting: An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration.
kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
Watch out: The added platform ownership buys value at this cost: KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
- Trace KMS to etcd through EncryptionConfig; the invariant is: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
- Recognize the symptom: An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration.
- Justify the cost: KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path.
- Verify with kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings instead of only inspecting YAML.
Benchmarks & rules of thumb
- 2
- KMS encryption boundary components: API server and external key service
- 1
- new provider placed first controls writes while older providers remain readable during rotation
- 0
- full protection for Secret values inside an authorized Pod memory
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the KMS owner contract: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database.
- Ignoring this telltale condition leads to unrelated changes: An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration.
- Repeating
kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | stringswithout an owner for remediation wastes retry cost. KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database?
- Which owner object, logs, and Events would you inspect for this symptom-An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration-?
- At what threshold would this cost become unacceptable: KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path?
kubectl get secret api -o yaml; etcdctl get /registry/secrets/prod/api | strings, name the failure, then justify the cost. Invariant: EncryptionConfiguration lets the API server encrypt Secret data to etcd using identity or provider order, and a KMS v2 provider can wrap data-encryption keys outside the database. Failure: An incorrect provider order, unavailable KMS endpoint, or unrotated old encryption key can cause startup failure, denied reads, or old records remaining decryptable under legacy configuration. Cost: KMS limits plaintext key exposure but places KMS latency, network, credentials, and key lifecycle on the control-plane critical path.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Encrypting Secrets at Rest in etcd with KMS Providers with generative AI interview Q&A and hands-on practice.