I rotated a database password in AWS Secrets Manager, and External Secrets Operator had the new value in the Kubernetes Secret on its next sync. Then I looked inside the pod that uses it and got two answers at once. The mounted file had the new password. The environment variable still had the old one. Same pod, no restart, no error, no event. This post is about that gap: what External Secrets Operator (ESO) does between Secrets Manager and a Kubernetes Secret, what happens after it has done its job, and what the cluster tells you when one of the links breaks. Everything ran on a one-node kind cluster with LocalStack standing in for AWS, so it costs nothing and you can break it as often as you like.
What is External Secrets Operator?
External Secrets Operator is a Kubernetes controller that copies values from an external secret store into ordinary Kubernetes Secrets, and keeps copying them on a schedule. You describe two things:
- a SecretStore (or a cluster-wide ClusterSecretStore): which backend, which region, how to authenticate;
- an ExternalSecret: which remote secret, which keys, into which Kubernetes Secret, and how often to look again.
The controller reads the remote value, writes the Secret, and owns it. Your Deployment does not change at all. It still says secretKeyRef or mounts a Secret volume, the way it did when the Secret was a YAML file.
AWS Secrets Manager is one of the backends ESO can read. It stores a secret as a string or a JSON document, keeps versions, and labels them with staging labels: AWSCURRENT for the live one, AWSPREVIOUS for the one before.
In the Vault post ESO read from Vault and the story was getting base64 values out of Git. Here the backend is Secrets Manager and the story starts where that one stopped: the value changed at the source, so who sees it, and when?
The problem, and why it matters
A password that never changes is a password that leaked at some point and nobody knows. So teams rotate. The rotation itself is usually well handled: there is a console button, a Lambda, a runbook. What is rarely checked is the other end, the running application.
Between the secret store and the process that opens the database connection there are several copies of the value. Each copy is refreshed by a different mechanism, and one of them is not refreshed at all. After a rotation, some pods have the new password and some have the old one, and both groups report healthy. Nothing fails until the old password is disabled. That usually happens later, on someone else's shift, and the error says "authentication failed" on a service nobody touched that day.
The obvious answer, "the operator syncs it, so we are fine", is true for exactly one of those copies. The rest of this post is the others.
What ESO with Secrets Manager gives you
| In practice | What changed in the lab | |
|---|---|---|
| SecretStore with the AWS provider | one object that knows the backend, region and credentials | every ExternalSecret in the namespace pointed at aws-sm and carried no credentials itself |
dataFrom.extract |
a JSON secret becomes one Kubernetes key per JSON key | p22/app/db turned into a Secret with username, password, host, port |
remoteRef.property |
pick one field out of a JSON secret | only password landed in a second Secret |
refreshInterval |
the controller looks again on a schedule | a rotation reached the Secret with no kubectl involved |
remoteRef.version |
read a staging label instead of the current value | AWSPREVIOUS still returned the old password after the rotation |
creationPolicy, deletionPolicy |
you decide what happens to the Secret when either side disappears | Owner removed the Secret with its ExternalSecret; Retain kept it when the source was deleted |
| ClusterSecretStore with conditions | one store for many namespaces, with a list of who may use it | the same manifest synced in demo and was refused in team-b |
The price: the value now exists in Secrets Manager and in etcd, and the cluster's copy is only as fresh as the last poll. ESO moves the secret. It does not make the application notice.
How it works: four places one value lives

Two things about this picture that the YAML does not say:
- Nothing pushes. Secrets Manager does not call your cluster when a value changes. ESO asks, every
refreshInterval. The Kubernetes Secret does not call your pod either. Every arrow is a poll or a one-time copy. - The last arrow is three arrows. An environment variable is copied into the container when it is created. A Secret volume is a set of files the kubelet keeps in sync. A
subPathmount is a single file bound once. They behave differently after a change, and most Deployments use at least two of them.
The lab
One kind node (kindest/node:v1.35.0), LocalStack 4.9 as a container on the same Docker network, External Secrets Operator 2.15.0 from its Helm chart, and one small Deployment called reader. No AWS account is involved; the AWS CLI in the lab is pinned to http://127.0.0.1:4610 with the dummy keys test/test, and the scripts refuse to run against anything else.
0. Pointing ESO at LocalStack
ESO has no "LocalStack mode", and the SecretStore has no endpoint field for Secrets Manager. What it has is two environment variables the controller reads at start, which I checked in the 2.15.0 source before relying on them. They go into the chart values:
extraEnv:
- name: AWS_SECRETSMANAGER_ENDPOINT
value: http://p22-localstack:4566
- name: AWS_STS_ENDPOINT
value: http://p22-localstack:4566
LocalStack runs on the kind Docker network, so pods resolve it by its container name. That is the whole integration. One consequence worth knowing: the override belongs to the controller, not to a store. Every AWS SecretStore that controller serves goes to the same endpoint, so you cannot mix "this store is local, that one is real AWS" in one installation. For a lab that is exactly the safety I want.
1. A store, and two ways to read a secret
Two secrets go into Secrets Manager: p22/app/db, a JSON document with four fields, and p22/app/api-key, a plain string. Then the store:
apiVersion: external-secrets.io/v1
kind: SecretStore
metadata: {name: aws-sm, namespace: demo}
spec:
provider:
aws:
service: SecretsManager
region: eu-central-1
auth:
secretRef:
accessKeyIDSecretRef: {name: aws-creds, key: access-key-id}
secretAccessKeySecretRef: {name: aws-creds, key: secret-access-key}
The auth.secretRef block is the local stand-in. It reads an access key from a Kubernetes Secret, which is the thing you are trying to get rid of. On EKS that block goes away: with IRSA the store names a ServiceAccount under auth.jwt.serviceAccountRef and the controller exchanges its token for a role; with EKS Pod Identity the controller's own ServiceAccount is associated with a role and the store needs no auth at all. I could not run either here. Both need a real EKS control plane, and LocalStack's community edition accepts any key pair without evaluating IAM. Treat the auth part of this lab as a placeholder, and everything after it as the real behaviour.
The first ExternalSecret takes the whole JSON document:
spec:
refreshInterval: 1h
secretStoreRef: {name: aws-sm, kind: SecretStore}
target: {name: app-db, creationPolicy: Owner}
dataFrom:
- extract:
key: p22/app/db
The second picks values one at a time: the plain string as it is, and a single field of the JSON secret through remoteRef.property.

extract is convenient and a little dangerous: whoever edits the JSON in Secrets Manager decides which keys exist in your Secret. A renamed field upstream is a missing key downstream. Where the application needs two fields, I list the two fields.
2. One pod, the same key three ways
The reader Deployment uses the password key in every way a pod can: as an environment variable through secretKeyRef, as a file in a mounted Secret volume, and as a single file mounted with subPath. At start all three print v1-winter-otter. So far this is any Deployment you have ever written.
3. Rotation, watched from four places
Now the promise from the end of the previous post. I write a new version with put-secret-value. Secrets Manager moves AWSCURRENT to it and labels the old one AWSPREVIOUS.

First stop: the Kubernetes Secret still holds the old value, and the ExternalSecret says SecretSynced, which is true. It synced, an hour-long interval ago. Nobody told Kubernetes anything. In the lab I nudge the controller by changing an annotation on the ExternalSecret, the same trick as in the Vault post; in production this is simply the interval expiring.
Once ESO has looked, the Secret has the new password. Then, inside the pod:

Read the third block slowly, because it is the whole post:
- The environment variable is still the old password. It was copied when the container was created and nothing will ever update it in that container.
- The file in the mounted volume is the new password. The kubelet rewrote it on its next sync. Same pod, zero restarts.
- The file mounted with
subPathis still the old password. AsubPathmount is bound once to the file as it was. It does not follow the volume.
All three came from the same key of the same Secret. The pod is Running, 1/1, and has no events. If the application read the password from the environment, it is using the old one. If it read the file at start and kept the value in memory, it is using the old one too, even though the file on disk is new. Only an application that re-reads the file, on a timer or on a failed login, has the new password without a restart.
kubectl rollout restart brings everything in line, because new containers get new copies. And the old value is not gone: an ExternalSecret with version: AWSPREVIOUS still returned v1-winter-otter. That label is what makes a safe rotation possible at all. For a while both passwords exist, and the database has to accept both until the last pod has moved.
4. Hands off: a short interval and Reloader
Nobody wants to run rollout restart after every rotation, so the usual pairing is a shorter refreshInterval and a controller that restarts workloads when their Secret changes. I used Stakater Reloader (chart 2.2.20): one annotation on the Deployment, reloader.stakater.com/auto: "true", and the ExternalSecret's interval set to ten seconds for the demo.

One put-secret-value, no kubectl, and a new pod came up with the new value in all three places. Reloader does it by adding an environment variable to the pod template whose value is a hash of the Secret; when the hash changes, the Deployment rolls like any other template change.
What it costs: a rotation is now a rollout. Every Deployment that references the Secret restarts when the value changes, at whatever moment the poll picks it up, with whatever rollout strategy and disruption budget that Deployment has. If those are sloppy, the rotation becomes the outage. The deployment strategies post is about exactly those settings.
5. Breaking it on purpose
The second half of the lab is failure. Three mistakes first: an ExternalSecret that points at a secret that does not exist, one that asks for the property passwd instead of password, and one whose store is in us-east-1 while the secret lives in eu-central-1.

Three different mistakes, one status: SecretSyncedError, with the message could not get secret data from provider. The event says the same sentence. The actual reason is only in the controller's log, in the external-secrets namespace, where an application team often cannot look. And two of the three reasons are the same words: a secret that is missing and a secret that exists in another region both read Secret does not exist. The store in the wrong region reports Valid and Ready the whole time. Whatever its validation checks, it is not whether the secret you want is there.
Then the backend goes away. I disconnect LocalStack from the cluster network and force a sync.

This is the good news of the whole design. The ExternalSecret turns red, and the Kubernetes Secret stays exactly as it was. Running pods keep working, with the last value ESO managed to fetch. A Secrets Manager outage does not become an application outage; it becomes a period in which rotations do not arrive. The red status took a moment to appear, because the AWS SDK retries before it gives up.
Next, the source secret is deleted. Two ExternalSecrets read the same remote secret and differ in one field, deletionPolicy.

A plain delete-secret in Secrets Manager does not delete anything yet. It schedules the deletion behind a recovery window, and during that window reads fail with marked for deletion. ESO treats that as an error, not as "gone", so even with deletionPolicy: Delete the Kubernetes Secret stays. Only when the secret is really gone does the policy decide: Retain, the default, keeps the last value and stays red; Delete removes the Kubernetes Secret and reports SecretDeleted with Ready: True, which looks odd until you read it as "I did what you asked".
Last, the other direction: someone deletes the ExternalSecret.

With creationPolicy: Owner, the default, the Secret carries an owner reference and is garbage-collected with its ExternalSecret. With Orphan it stays. The interesting part is what the workload does. The running pod notices nothing: its environment variable and even its mounted files stay as they were. The next pod cannot start. Mine sat in ContainerCreating with MountVolume.SetUp failed for volume "db" : secret "app-db" not found; a pod that uses the Secret only as an environment variable reports CreateContainerConfigError instead. So the deletion is silent until the next deploy, node drain or scale-up, and then it blocks. When I applied the ExternalSecret again, the stuck pod started by itself on the kubelet's next retry.
6. One store for the whole cluster
A ClusterSecretStore is the same provider block without a namespace, usable from any namespace unless you say otherwise. I said otherwise, with conditions: [{namespaces: [demo]}], and applied an identical ExternalSecret in demo and in team-b. The first synced. The second showed the same generic SecretSyncedError, and the log line was the clearest of the day: using cluster store "aws-sm-shared" is not allowed from namespace "team-b": denied by spec.condition. Without the condition, any namespace that can create an ExternalSecret can read any secret the store's credentials can read.
Limits and rules you only learn by hitting them
- ESO polls; it is not notified.
refreshIntervalis the upper bound on how stale the Kubernetes Secret can be. An hour is a common default and means a rotation can take an hour to reach the cluster, plus whatever the pod needs. - Every refresh is an API call. Secrets Manager bills per stored secret and per API request, so a short interval multiplied by many ExternalSecrets is a line on the invoice and can run into request throttling. Pick the interval from how fast a rotation must land, not from habit.
refreshInterval: 0means "fetch once". That is from the documentation, not from this lab. Useful for values that must never change under a running system; it also means a rotation never arrives.- Environment variables are frozen at container start. There is no setting for this. It is how processes work.
subPathmounts do not update. If you mount a single key withsubPathto avoid hiding a directory, you have opted out of file updates. Mount the volume into its own directory instead.- A mounted file updates after the kubelet's sync, not instantly. There is a delay between the Secret changing and the file changing, and the application still has to re-read it.
extractfollows the upstream JSON. Keys added or renamed in Secrets Manager appear or disappear in the Kubernetes Secret on the next sync.- The status message is generic.
could not get secret data from providercovers a missing secret, a wrong property, a wrong region, a denied namespace and an unreachable endpoint. Give the people who own ExternalSecrets a way to read the controller's log, or ship that log somewhere they can search. - A store can be
Validand useless. Validation did not catch a wrong region in the lab. - The endpoint override is controller-wide. Good for a lab, wrong for any cluster that should reach real AWS.
- The Secret is still a Kubernetes Secret. ESO does not encrypt it. Anyone who can read Secrets in the namespace reads the value. Encryption at rest for etcd and tight RBAC are still your job.
- What this lab could not show: IRSA and Pod Identity (no EKS),
AccessDeniedException(LocalStack community does not evaluate IAM), and managed rotation with a Lambda (rotation here is a plainput-secret-value). There is also a new official AWS emulator, released on 2026-11-11; I have not used it for this post, and it is the subject of the next one.
Moving a fleet, not a lab
One namespace and three secrets is a lab. Forty namespaces owned by eight teams need a few decisions made once, by someone:
- Name secrets by path, and make the path the permission.
team/app/purpose, with the IAM policy of each store allowingGetSecretValueon its own prefix only. The lab cannot enforce this, because LocalStack does not evaluate IAM. On EKS it is the difference between a store and a master key. - Decide who owns stores. Either one ClusterSecretStore per trust boundary with
conditionslisting the namespaces, owned by the platform team, or a namespaced SecretStore per team bound to that team's role. The first is less YAML, the second is a smaller blast radius. Mixing them without a rule is howteam-bends up reading production. - Use workload identity, not keys. IRSA or Pod Identity for the controller or per store. A long-lived access key in a Kubernetes Secret, so that ESO can fetch other secrets, is the problem moved one level down.
- Set
refreshIntervalper class of secret. Database credentials that rotate on a schedule get a short one; a third-party API key that changes twice a year does not need to be polled every minute. - Choose the restart story explicitly. Reloader on everything, Reloader only where the annotation is set, or applications that re-read files. Write it down next to the rotation runbook, because rotation is not finished when Secrets Manager says so. It is finished when the last pod uses the new value.
- Rotate with an overlap. The old credential has to keep working until every consumer has moved. Secrets Manager's staging labels exist for this; a rotation that disables the previous password in the same step turns "some pods have the old value" into an incident.
- Alert on the red status. ESO exports metrics for the sync status of every ExternalSecret (I did not scrape them in this lab). An ExternalSecret that has been
SecretSyncedErrorsince last week is how a rotation silently never arrives. - Protect the ExternalSecret like the Secret. With
creationPolicy: Owner, deleting or renaming it, or pruning it from GitOps by mistake, deletes the Secret, and nothing complains until the next pod starts.
What this does not solve: an application that caches a credential forever. No operator can reach into a process.
Frequently asked
Does External Secrets Operator restart pods when a secret changes? No. It updates the Kubernetes Secret and stops there. Restarting is your job: kubectl rollout restart, a tool such as Reloader, or an application that re-reads the mounted file.
Why does my pod still have the old secret after rotation? Most likely it reads the value from an environment variable, which is fixed when the container starts, or from a subPath mount, which does not update. A file in a normally mounted Secret volume does update, after the kubelet's next sync.
How often does ESO check AWS Secrets Manager? Every refreshInterval of the ExternalSecret. It is a poll, so a change at the source is invisible to the cluster until the next one. Changing an annotation on the ExternalSecret, as the lab does with force-sync, triggers a sync right away.
Can ESO work with LocalStack? Yes. Set AWS_SECRETSMANAGER_ENDPOINT (and AWS_STS_ENDPOINT) on the controller through the chart's extraEnv, and make sure pods can reach the LocalStack address. In ESO 2.15.0 the override applies to the whole controller.
What happens to my pods if Secrets Manager is unreachable? Nothing immediately. The ExternalSecret reports SecretSyncedError, the Kubernetes Secret keeps its last value, and running pods keep working with it. You lose new values, not existing ones.
What is the difference between creationPolicy and deletionPolicy? creationPolicy is about the ExternalSecret going away: Owner deletes the Secret with it, Orphan leaves it. deletionPolicy is about the source secret going away: Retain keeps the Kubernetes Secret, Delete removes it.
SecretStore or ClusterSecretStore? A SecretStore lives in one namespace and serves it. A ClusterSecretStore serves every namespace unless its conditions restrict it. Use the cluster-wide one when the platform team owns the credentials, and always with conditions.
Should I use ESO or the Secrets Store CSI Driver? ESO if your workloads consume Kubernetes Secrets, especially as environment variables. The CSI driver if the requirement is that the value never lands in etcd. The table below has the long version.
Where it broke
1. could not get secret data from provider
The status and the event of every failed ExternalSecret in this lab, whatever the cause. I had the real reason only after reading the controller's log: error processing spec.data[0] (key: p22/app/db), err: key passwd does not exist in secret p22/app/db. If you own ExternalSecrets and cannot read that log, ask for access before the first incident.
2. Secret does not exist, for a secret that exists
The store pointed at us-east-1, the secret was in eu-central-1. The store was Valid and Ready. The log line is identical to the one for a secret that truly does not exist, so check the region before you check the name.
3. exceeded maximum number of attempts, 3 ... dial tcp: lookup p22-localstack on 10.96.0.10:53: server misbehaving
The backend was unreachable. The ExternalSecret kept showing SecretSynced until the SDK had finished its retries, so for a short while the status was greener than reality. The Secret and the pods were unaffected.
4. InvalidRequestException: You can't perform this operation on the secret because it was marked for deletion
I expected deletionPolicy: Delete to remove the Kubernetes Secret as soon as I ran delete-secret. It did not. A secret scheduled for deletion is an error to ESO, not an absence. The Secret was removed only after a forced delete.
5. MountVolume.SetUp failed for volume "db" : secret "app-db" not found
My own test failed here first. I had asserted that the new pod would show CreateContainerConfigError, and the script stopped with FAIL new pod status: ... ContainerCreating ... does not contain 'CreateContainerConfigError'. A pod that mounts the missing Secret as a volume never gets as far as creating the container; it waits in ContainerCreating. Only a pod that uses the Secret purely as an environment variable shows CreateContainerConfigError. Dashboards that look for one of the two miss the other.
6. jq: parse error: Invalid numeric literal at line 2, column 2
Self-inflicted. My helper printed the command before running it, I piped the helper into jq, and jq got the echoed command line as JSON. Worse, the phase ran under tee without pipefail, so the failure did not stop the run: the next phase created the Deployment before its Secret existed and ended in error: timed out waiting for the condition. The Makefile now sets pipefail.
7. The subPath file that never changed
No error line for this one. The file mounted with subPath kept the old password until the pod was replaced, while the file next to it, from the same volume, had the new one.
The trade-off, side by side
How the secret gets from Secrets Manager to the application. Only the first column ran in this lab; the other two are from running them elsewhere and from their documentation.
| External Secrets Operator | Secrets Store CSI Driver (AWS provider) | Application calls Secrets Manager (SDK) | |
|---|---|---|---|
| How | controller copies the value into a Kubernetes Secret | a CSI volume mounts the value into the pod as a file at start; syncing to a Kubernetes Secret is optional | the process fetches the value itself, with its own IAM identity |
| Plus | workloads stay plain Kubernetes: secretKeyRef, volumes, Helm charts unchanged; one place to see sync status; survives a backend outage with the last value |
the value does not have to exist in etcd; access is per pod identity | no copy in the cluster at all; the application decides when to re-read; rotation can be picked up without a restart |
| Minus | the value lives in etcd as a normal Secret; freshness is a poll; pods are not restarted | environment variables need the optional Secret sync, which puts the value back in etcd; a daemon on every node; a pod cannot start if the backend is down | every application needs AWS code, credentials handling, caching and retry; behaviour differs per language and team |
| Where it fits | many teams, existing charts, environment variables everywhere | strict "not in etcd" requirements, file-based consumers | a few services that you own end to end and that must follow rotation closely |
Environment variable or mounted file, for the same Kubernetes Secret:
Environment variable (secretKeyRef) |
Mounted file (Secret volume) | |
|---|---|---|
| After the Secret changes | old value until the pod is replaced | new value after the kubelet's sync, in the same pod |
| Plus | every framework reads it; one consistent value for the life of the pod; easy to reason about | can follow a rotation without a restart, if the application re-reads the file |
| Minus | a rotation needs a rollout; visible in the process environment and to anything that dumps it | the application has to re-read; subPath silently turns it back into a frozen copy; old and new can coexist across pods for a while |
| Where it fits | stateless services that roll cheaply, with Reloader or a restart step in the rotation runbook | long-lived connections and workloads that are expensive to restart |
Neither column is the right answer. In the lab I ended up with ESO, a short interval on the credentials that rotate, environment variables, and Reloader on the Deployments that opt in. That is the least code for a team that already deploys well. For a workload that cannot restart on someone else's schedule I would mount the file and make the application re-read it.
When to use which
- ESO when the cluster's workloads already expect Kubernetes Secrets and you want the source of truth out of Git and out of the cluster.
- A short
refreshIntervalonly for secrets that actually rotate, and only as short as the rotation needs. - Reloader, or a restart step, for everything that reads secrets from the environment. Otherwise the rotation is half done.
- A mounted volume without
subPathfor applications that can re-read a file. deletionPolicy: Retainunless you are sure a deleted source must take the workload down with it.creationPolicy: Ownerwith the ExternalSecret protected in Git;Orphanfor a Secret you are migrating and do not want to lose to a pruned manifest.- ClusterSecretStore with
conditions, never without.
Your call
I keep secrets as environment variables and let Reloader roll the Deployment when ESO brings a new value, because my services restart cheaply and I would rather have one consistent value per pod than two. That is for my cluster, not a rule for yours. Two things I would like to hear from real systems:
- After a rotation, how do your pods get the new value: a restart someone triggers, a tool like Reloader, or an application that re-reads a file?
- Who finds out first that an ExternalSecret has been failing for a week: an alert, or the next deploy?
I am not after who is right. I want the pluses and minuses of the columns above to be visible to everyone who reads this, in words from real clusters, and the comments are where that happens: https://www.linkedin.com/in/mirac-can-yilmaz
Summary
- External Secrets Operator copies a value from AWS Secrets Manager into a Kubernetes Secret and polls for changes every
refreshInterval. It does not notify or restart anything. - After a rotation, an environment variable keeps the old value until the pod is replaced, a mounted Secret volume gets the new value in the same pod after the kubelet's sync, and a
subPathmount stays old. - Reloader, or a restart step in the runbook, closes the gap for environment variables, at the price of a rollout per rotation.
- If Secrets Manager is unreachable, the Secret keeps its last value. If the ExternalSecret is deleted with
creationPolicy: Owner, the Secret goes and the next pod cannot start. - Every failure looks the same in
kubectl get externalsecret. The reason is in the controller's log. - Locally, ESO reaches LocalStack through
AWS_SECRETSMANAGER_ENDPOINTon the controller; IRSA, Pod Identity and IAM denial need real EKS.
Next in the series
This is post 9 of Core Skills. Previous: What Is a Reusable Workflow in GitHub Actions? The LocalStack setup is the one from the Terragrunt post, and the first half of this story, getting secrets out of Git, is in Moving Secrets into Vault. Next: What Is AWS Emulator?, AWS's new local emulator next to LocalStack, on the same scenario.
The code for this lab (the kind config, the ESO values, every manifest including the failure cases, and the scripts that run and assert each phase) is shared with Lab Access members on Buy Me a Coffee; the repo invite comes by email after you join: https://buymeacoffee.com/miraccanyilmaz/membership