External Secrets Operator on Kubernetes: Vault and AWS Secrets Manager Sync
External Secrets Operator on Kubernetes keeps Vault or AWS Secrets Manager as the source of truth, syncs selected values into native Kubernetes Secrets, and turns rotation into a controlled reconciliation problem instead of a copy-and-paste exercise.
Introduction: External Secrets Operator on Kubernetes without secret values in Git
Illustrative composite: a database password is rotated in Vault during an incident, but the Kubernetes Secret in Git still holds the old value, so new pods fail authentication while older pods keep serving traffic. External Secrets Operator on Kubernetes prevents that split by syncing the provider value into the cluster on a schedule.
The previous roadmap lesson, Kubernetes Gateway API tutorial, dealt with traffic entering the cluster. This lesson stays inside the cluster boundary and asks a different operational question: where should a workload credential live before Kubernetes hands it to a pod? The answer matters because a native Secret is a delivery format, not a full secret-management system.
The 5-minute takeaway: keep the value in Vault or AWS Secrets Manager, commit only an ExternalSecret reference, give the operator a narrow provider identity, and verify rotation at the workload rather than at the provider. ESO removes manual copying, but it does not remove the need for etcd encryption, RBAC discipline, or a pod restart when a container reads credentials from environment variables.
1. What External Secrets Operator on Kubernetes actually syncs
External Secrets Operator on Kubernetes is a controller that reads selected values from an external secret manager and writes them into native Kubernetes Secrets. The provider remains the source of truth, Git holds references instead of values, and applications keep consuming ordinary Secrets through environment variables or mounted files.
That last point explains both the appeal and the limit. ESO does not invent a new way for an application to read a password. It creates or updates a Secret object, then Kubernetes delivers that object through the normal mechanisms. If the application already reads secretKeyRef, envFrom, or a Secret volume, the workload manifest usually needs little change. The operational change sits upstream: the value now comes from a provider with its own policy, audit trail, versioning, and rotation workflow.
The sync loop is pull-based. The controller watches ExternalSecret resources, resolves the referenced store, authenticates to the provider, fetches the requested data, renders the target Secret, and repeats the process according to the refresh policy. Nobody pushes a value from Vault into the cluster. The cluster asks for the value through an identity that the provider can allow, deny, log, and revoke.
This also means ESO is not a substitute for understanding native Secrets. Base64 is still an encoding, not encryption. A synced Secret still needs protection in etcd, tight RBAC, and careful handling in logs and support bundles. The Kubernetes ConfigMaps and Secrets guide covers native consumption and update behavior; this lesson focuses on how the value arrives and stays current.
2. External Secrets Operator on Kubernetes architecture: stores, ExternalSecrets, and targets
The External Secrets Operator on Kubernetes object model has three moving parts: a store describes provider access, an ExternalSecret describes the values to fetch, and the controller creates the target Secret. SecretStore is namespace scoped, ClusterSecretStore is cluster scoped, and that scope decision sets the first blast-radius boundary.
A SecretStore lives in one namespace and can be referenced by ExternalSecret resources in that namespace. That makes it a natural fit for team-owned namespaces because the provider identity, provider path, and target Secrets can all be reviewed as one local unit. A platform team can still provide templates or policy checks, but a compromised namespace has a smaller path to provider data.
A ClusterSecretStore is available across namespaces unless conditions restrict it. That convenience is useful for a central platform service, but it also creates a shared gateway. If one cluster store carries a broad Vault policy or a broad AWS role, any namespace allowed to reference it may be able to request values outside its own boundary unless provider policy and namespace conditions prevent that. Treat a cluster store as shared infrastructure with an explicit tenant model, not as a harmless shortcut.
The ExternalSecret is the developer-facing contract. It names the store, the remote key, optional properties, the target Secret name, and the refresh behavior. Reviewers can inspect that contract without seeing the value. Operators can inspect its status without printing the value. That separation is the core design: desired references are visible, secret material stays in the provider until the controller materialises the minimum target copy.
3. External Secrets Operator on Kubernetes installation and controller boundaries
Installing External Secrets Operator on Kubernetes adds custom resources and a controller that reconciles them, but installation alone grants no provider access. You still need a store, a workload identity, provider permissions, and a target namespace policy. Treat the controller as platform infrastructure, not as an application sidecar.
Install the operator through your normal platform path, then verify that the custom resources are served before applying examples. Current project documentation uses external-secrets.io/v1; older indexed examples may show an earlier API version. Check the cluster rather than copying an API version blindly.
The controller namespace deserves the same care as other control-plane namespaces. Restrict who can change the release, who can read controller logs, and who can create cluster-scoped stores. A user who can create a broad ClusterSecretStore and reference it from a namespace has a powerful path to provider data, even if that user cannot directly read every target Secret.
Network policy also belongs in the installation review. The controller needs egress to the provider endpoint and to the Kubernetes API. It does not need broad egress to every application namespace. If Vault runs inside the cluster, allow the exact service path. If AWS Secrets Manager is reached through a VPC endpoint, test DNS and TLS from the controller's network position, not from a laptop.
Upgrades need the same discipline as any other control-plane change. Test the chart and CRDs in a non-production cluster, confirm that existing stores still report Ready, and watch a representative ExternalSecret complete a fresh sync before widening the rollout. Secret synchronisation failures are quiet by design because the last good Secret often remains in place, so upgrade verification should prove new reconciliation works rather than merely proving old pods still run.
4. External Secrets Operator on Kubernetes with HashiCorp Vault Kubernetes auth
External Secrets Operator on Kubernetes can authenticate to HashiCorp Vault with a Kubernetes ServiceAccount token instead of a stored Vault token. Vault validates that token, maps it to a role, and returns a short-lived Vault token whose policy should allow reads only under the application path.
The Vault side has three pieces that must agree. First, Vault's Kubernetes auth method must be configured to validate tokens for the cluster. Second, a Vault role must bind the ServiceAccount name and namespace that ESO will present. Third, the role must attach a policy that allows reads on the KV v2 data path for the application. If an audience is configured on either side, both sides must use the same value.
The Kubernetes side then names the same ServiceAccount and role. For a KV v2 mount at secret, the store path is secret, the version is v2, and the ExternalSecret remote key is relative to that mount. Do not add the data/ segment to the remote key; Vault policy paths use secret/data/..., while the ESO key stays production/payments/database.
A namespaced store keeps the Vault role close to the workload namespace. That is usually the safer default for multi-team clusters. A cluster store can still work, but the Vault policy must not become a cluster-wide read grant by accident. If several namespaces share one store, split Vault roles and policies by tenant or environment and restrict which namespaces may reference the store.
Path naming is part of the security model. Put environment and service boundaries in the Vault path, then make the policy match that structure exactly. A path such as production/payments/database is reviewable because the environment, owner, and dependency are visible before anyone reads the policy. Avoid shared paths that mix production and staging values; a single broad policy then turns a naming shortcut into cross-environment access.
5. External Secrets Operator on Kubernetes with AWS Secrets Manager and IRSA
External Secrets Operator on Kubernetes reads AWS Secrets Manager through an AWS identity attached to a ServiceAccount or inherited by the controller pod. The production pattern is workload identity with a narrow IAM policy, not long-lived access keys copied into a Kubernetes Secret.
On EKS, the clean pattern is a ServiceAccount annotated with an IAM role. ESO's AWS provider can reference that ServiceAccount through JWT auth, or the controller can use its own pod identity when the store does not specify another auth method. Per-namespace ServiceAccounts give clearer isolation: the payments namespace reads payments secrets, and the reporting namespace cannot borrow that role by creating an ExternalSecret with a creative key name.
The IAM policy should name the secret resources, not the whole account. Start with secretsmanager:GetSecretValue on the exact secret name prefix for the namespace or service. Add KMS decrypt permission only when the secret uses a customer managed key and the key policy requires it. Add discovery permissions only for features that need them, such as finding secrets by name or tag, and review that expansion as a separate decision.
Account-level identity design still matters. The AWS IAM Identity Center and multi-account guide covers the broader account model; for ESO, the practical rule is narrower: one workload identity, one environment boundary, and a resource policy that a reviewer can read without guessing.
6. External Secrets Operator on Kubernetes ExternalSecret mapping and templates
An ExternalSecret for External Secrets Operator on Kubernetes maps remote keys and properties to keys in one target Secret. Explicit data mappings are easiest to review, while dataFrom can extract a whole structured secret when the provider object and the application contract already match.
Use spec.data when the target keys are part of an application contract. The reviewer sees exactly which remote property becomes username, password, or api-key. That precision matters during incidents because a missing property or renamed field fails in a visible place. It also prevents a provider-side JSON object from quietly adding keys that the workload never expected.
Use spec.dataFrom.extract when the provider object is already shaped like the target Secret and the team accepts that contract. Extraction is convenient for a JSON secret whose fields map directly to Secret keys. It is weaker for review because the manifest no longer lists every key. If extraction is used, add a test or policy check that verifies required keys exist after sync.
Templates should stay boring. Set the Secret type, labels, and annotations when needed. Use value transformation only when the application truly needs a rendered file or a derived format, and test that rendering without printing real values. A template that builds connection strings can hide escaping bugs and can turn a simple rotation into a parsing failure.
Ownership fields deserve the same review. creationPolicy: Owner makes the target Secret owned by the ExternalSecret, so deleting the ExternalSecret garbage-collects the Secret. deletionPolicy: Retain is the safer default when a provider value disappears, because the cluster keeps the last synced copy while operators investigate. Choose different values deliberately, with the failure case written down.
7. External Secrets Operator on Kubernetes refreshInterval and rotation behavior
External Secrets Operator on Kubernetes refreshes values by polling the provider at the configured refresh interval, then updating the target Secret when the fetched data changes. That sync is only the middle of rotation: mounted files refresh later, and environment variables require new containers.
Set refreshInterval from the rotation requirement, not from habit. A short interval reduces the delay between provider change and Secret update, but it also increases provider API calls and can hide a broken rollout behind constant churn. A long interval reduces load, but it extends the window where the provider and cluster disagree. For credentials that rotate during incidents, minutes may be justified. For stable third-party tokens, an hour may be plenty.
The default refresh behavior is periodic. If the interval is omitted, the API default applies. A zero interval or a created-once policy changes the contract: the Secret is synced once and then left alone unless the object changes or the target is recreated according to policy. Use those settings only for values that must be generated or captured once, and pair them with an explicit recovery plan.
Force-sync updates the Secret; it does not force the application to read the new value. Containers that received the secret through environment variables keep the old environment until they restart. Containers that read a mounted Secret volume may see updated files after kubelet refresh, but the application still has to reload the file or reopen the connection. Rotation is complete only when the workload proves it can authenticate with the new value.
Provider-side rotation also needs overlap. If Vault or AWS Secrets Manager replaces a database password before every consumer has restarted, old pods may fail while new pods succeed. Use dual credentials, staged rollout, or a maintenance pattern that matches the dependency. ESO shortens the copy delay; it does not make a non-overlapping credential change safe.
8. External Secrets Operator on Kubernetes RBAC and blast-radius controls
External Secrets Operator on Kubernetes concentrates provider access in the controller path, so store scope and identity scope decide how far a mistake can spread. A namespaced store with a narrow provider policy contains damage better than one cluster store backed by broad read permissions.
Review three permission planes separately. The provider plane decides which Vault paths or AWS secret resources the identity can read. The store plane decides which namespaces may reference that identity through a SecretStore or ClusterSecretStore. The Kubernetes plane decides who can read, list, watch, update, or delete the synced Secrets after ESO writes them. A narrow provider policy does not help if every namespace can reference the store, and a narrow store does not help if broad RBAC lets many users list Secrets.
Prefer namespaced stores for tenant isolation. Use a cluster store when the platform team intentionally operates a shared secret gateway, then add namespace conditions and provider policies that match the tenant model. For a ClusterSecretStore, include the namespace in ServiceAccount and Secret references so resolution is unambiguous. Test a negative case: an ExternalSecret in a disallowed namespace should fail before it reads provider data.
Keep human access to synced Secrets narrow. Applications usually do not need Kubernetes API permission to read their own Secret object; kubelet delivers env and volume data without giving the workload a general Secret-read role. Grant debugging access by named Secret and verb where possible, and avoid list and watch on Secrets for broad groups.
The kubectl master guide covers the wider inspection workflow. For secret sync, the habit to build is simple: inspect status, conditions, events, and key names before anyone reaches for a decoded value.
9. External Secrets Operator on Kubernetes GitOps workflow without secret values
External Secrets Operator on Kubernetes fits GitOps because the repository can hold the store reference, remote path, target name, and refresh policy without holding the secret value. Reviewers see the dependency and its scope, while the provider remains responsible for value history and access audit.
That changes code review in a useful way. A pull request can show that payments-api will read production/payments/api through aws-payments every 30 minutes. It cannot show the API key, and it should not. Reviewers check naming, namespace, provider path, target keys, refresh interval, and whether the change belongs in that environment. Security review shifts from hunting encoded values to checking reference scope.
Ordering still matters. The store and its identity must exist before the ExternalSecret can sync. The target Secret must exist before a workload that requires it can start cleanly. GitOps controllers can apply objects in waves or sync phases, but the operational rule is clearer than the tool feature: apply identity and store first, wait for Ready, apply the ExternalSecret, wait for sync, then roll the workload.
Repository policy should reject native Secret values in application manifests unless a documented exception exists. It should also reject broad cluster stores, static cloud keys, and provider paths that cross environment boundaries. The GitOps best practices guide covers drift and rollback patterns; ESO adds one specific rule: Git is the record of references, not the vault.
CI has a boundary here too. A pipeline may validate manifests and run policy checks, but it should not fetch production values to prove a manifest is correct. The GitHub Actions security best practices guide covers CI identity hardening. For ESO, keep CI out of the value path and let the cluster controller perform the read under its own scoped identity.
10. External Secrets Operator on Kubernetes vs native Secrets and the CSI driver
External Secrets Operator on Kubernetes differs from manual native Secrets and the Secrets Store CSI Driver mainly in custody and delivery. ESO copies selected values into native Secrets, manual Secrets make the cluster the source of truth, and CSI mounts provider values as pod files.
Choose ESO when the platform wants one sync path for many workloads and applications already consume native Secrets. It works well for environment variables, Secret volumes, image pull secrets, and TLS Secrets because the output is a normal Secret object. The cost is custody: a copy exists in Kubernetes, so etcd encryption, RBAC, backup handling, and audit still matter.
Choose CSI delivery when avoiding a persistent native Secret is a hard requirement and the workload can read files. The identity usually sits closer to the workload, and the value arrives through a mounted volume. The cost is application and platform complexity: file reload behavior, provider support, node components, and pod start dependencies become part of the design.
| Question | Native Secret managed manually | External Secrets Operator | Secrets Store CSI Driver |
|---|---|---|---|
| Source of truth | Kubernetes manifest or manual process | Vault, AWS Secrets Manager, or another provider | Vault, AWS Secrets Manager, or another provider |
| Delivery into pod | Env vars or Secret volume | Native Secret, then env vars or Secret volume | Mounted files, with optional Secret sync |
| Value stored as Kubernetes Secret | Yes | Yes | No, unless sync is enabled |
| Rotation path | Manual update plus rollout | Provider change, ESO sync, then workload reload or restart | Provider change, CSI refresh where supported, then app reload |
| Identity holder | Person or pipeline creating the Secret | ESO store identity | Usually workload or node/provider identity |
| Best fit | Small static values with strict process | GitOps teams standardising on native Secrets | Workloads that must avoid persistent Secret copies |
Manual native Secrets still have a place for bootstrap material and tiny local clusters. The failure mode appears when manual copying becomes the production rotation system. At that point the cluster holds stale values, Git holds encoded values, and nobody can prove which copy is current without inspecting the secret itself.
A practical decision rule is to standardise on ESO for ordinary application credentials, then reserve CSI delivery for the smaller set of values whose threat model forbids a persistent Secret copy. That keeps the common path simple for teams while still giving security reviewers an escape hatch for high-value material. Mixing both patterns is acceptable when the boundary is explicit; mixing them accidentally creates two rotation stories for the same credential.
11. External Secrets Operator on Kubernetes troubleshooting matrix
Troubleshooting External Secrets Operator on Kubernetes starts with the Ready condition on the ExternalSecret, then moves to the store, provider identity, remote key, network path, and target Secret ownership. Most failures belong to one of those layers, and the event message usually names it.
Start with status, not with the value. kubectl describe externalsecret shows conditions and events. A Ready condition with SecretSynced means the last sync succeeded. SecretSyncedError means the controller attempted the sync and failed; the message points to provider auth, missing data, template rendering, or target ownership. If the store is not Ready, fix the store first because an ExternalSecret cannot sync through a broken provider connection.
| Symptom | Likely layer | Check | Fix |
|---|---|---|---|
| Store Ready is false | Provider connection or auth | Store events, endpoint, region, CA, ServiceAccount reference | Correct provider config and identity before touching ExternalSecrets |
SecretSyncedError with permission denied |
Provider policy | Vault role binding or IAM resource scope | Narrow or correct the policy path, role, namespace, or secret ARN |
cannot find secret data for key |
Remote mapping | Remote key, KV mount path, property name, JSON shape | Use the provider-relative key and exact property |
| Secret exists but app uses old value | Workload consumption | Env var source, mounted file reload, pod start time | Restart pods for env vars or fix application file reload |
| Target Secret owned by another object | Ownership conflict | Existing Secret ownerReferences and creationPolicy | Remove the conflict deliberately or choose a merge policy with a written reason |
| Sync works in one namespace only | Store scope | Cluster store namespace conditions and reference namespaces | Add the intended namespace condition or use a namespaced store |
| Provider timeout from controller | Network path | DNS, egress policy, VPC endpoint, Vault service reachability | Allow the exact provider path from the controller namespace |
Avoid decoding the target Secret as a first step. Check key names, resource version changes, refresh time, and application authentication logs. If a value must be verified, use a controlled break-glass process that does not paste the value into tickets, chat, or shell history.
Provider outages need a separate expectation. When Vault or AWS Secrets Manager is unreachable, ESO cannot fetch a fresher value, but the last synced native Secret normally remains available for existing workloads and for new pods that only need that Secret object. That resilience is useful, yet it can hide staleness. Alert on stale refresh time and repeated sync errors so a quiet provider outage does not become a surprise during the next credential rotation.
12. External Secrets Operator on Kubernetes production checklist and next roadmap step
A production rollout of External Secrets Operator on Kubernetes should prove identity, sync, consumption, rotation, and failure behavior before teams depend on it. Start with one namespace, one provider path, and one workload, then widen only after alerts and rollback steps are boring.
Run the first rollout like a small platform launch. Pick a non-critical workload with a credential that can be rotated safely. Create the provider identity, apply the store, confirm Ready, apply the ExternalSecret, confirm the target keys, then rotate the provider value in a controlled window. Watch the Secret update, watch the workload adopt the value, and record how long each step took.
Final checklist:
- Provider is the source of truth; Git contains references only.
- Store scope matches the tenant boundary, with namespace conditions on any cluster store.
- Vault role or IAM policy reads only the intended paths or secret resources.
- Static cloud keys and stored Vault tokens are absent from the production path.
ExternalSecretmappings name the expected target keys and properties.- Refresh interval matches the rotation requirement and provider load budget.
- Env-var workloads have a rollout step; file-based workloads reload or reopen connections.
- Etcd encryption at rest is enabled and Secret RBAC avoids broad list or watch access.
- Alerts fire on store not Ready, ExternalSecret not Ready, stale refresh time, and repeated sync errors.
- Rollback keeps the previous provider value valid until consumers prove the new value works.
The next roadmap step moves from configuration custody to namespace guardrails: Kubernetes requests, limits, and quotas. That pairing is deliberate. A platform that can deliver the right secret still needs limits on how much compute each namespace may consume.
Frequently Asked Questions
What does External Secrets Operator on Kubernetes do?
External Secrets Operator on Kubernetes reads selected values from an external provider and creates or updates native Kubernetes Secrets. A store defines provider access, an ExternalSecret defines the remote keys and target Secret, and the controller reconciles the target on a refresh schedule.
What is the difference between SecretStore and ClusterSecretStore in External Secrets Operator on Kubernetes?
A SecretStore is namespace scoped and serves ExternalSecrets in that namespace. A ClusterSecretStore is cluster scoped and can serve many namespaces, ideally with namespace conditions. Prefer namespaced stores when tenant isolation matters; use a cluster store only when the shared identity and provider policy are deliberately designed.
How does External Secrets Operator on Kubernetes authenticate to Vault?
With Kubernetes auth, ESO presents a ServiceAccount token to Vault. Vault validates the token, maps the bound ServiceAccount name and namespace to a role, and returns a short-lived token with the role policy. The policy should allow reads only on the application KV paths.
How does External Secrets Operator on Kubernetes sync AWS Secrets Manager?
ESO uses an AWS identity from a referenced ServiceAccount or from the controller pod identity. On EKS, IRSA or pod identity avoids static keys. The IAM policy should allow secretsmanager:GetSecretValue only on the intended secret resources, with KMS decrypt added only when required.
Does External Secrets Operator on Kubernetes rotate secrets automatically?
ESO syncs changed provider values into the target Secret, but the application still has to consume the change. Mounted files may refresh after kubelet sync if the app reloads them. Environment variables require new containers, so rotation usually includes a rollout step.
Is External Secrets Operator on Kubernetes safer than a native Kubernetes Secret?
It is safer for source control and rotation because values stay in the provider and Git holds references. The synced value still becomes a native Secret, so etcd encryption, RBAC, backups, and log handling remain necessary. ESO improves custody and freshness; it does not make Secret access harmless.
Why is my ExternalSecret not syncing in External Secrets Operator on Kubernetes?
Check the ExternalSecret Ready condition and events first, then the store Ready condition. Common causes are provider permission errors, wrong remote key or property, missing namespace on a cluster-store reference, unreachable provider endpoint, and a target Secret owned by another object.
Preparing for Senior Platform & SRE Interviews
Practice real-world cluster triage, RBAC debugging, and pod scheduling scenarios in our Kubernetes scenario interview questions hub.
Explore Interview Scenarios →