The External Secrets Operator (ESO) solves a classic problem for anyone running Kubernetes with GitOps: the manifest has to live in Git, but the secret can't. With ESO, the repository stores only the reference to the secret; the value stays in AWS Secrets Manager and is synced into a native Secret inside the cluster.
In this guide: how the operator works, how to install it on Amazon EKS, how to authenticate with EKS Pod Identity without static credentials, how to apply least privilege per namespace, and what to watch for in rotation, cost, and operations.
What is the External Secrets Operator
ESO is an open source Kubernetes operator that reads secrets from external APIs (AWS Secrets Manager, HashiCorp Vault, Azure Key Vault, among others) and materializes them as Secret objects. It works with three main resources:
- SecretStore: a namespaced resource that describes how to access an external provider (service, region, authentication). It does not reference resources in other namespaces.
- ClusterSecretStore: the cluster-scoped variant, usable from multiple namespaces.
- ExternalSecret: declares which secrets to fetch, from which store, and which
Secretto write them to.
The examples in the current documentation use the external-secrets.io/v1 API for SecretStore and ExternalSecret. If your cluster still has manifests on earlier API versions, plan the migration before upgrading the operator.
ESO or Secrets Store CSI Driver?
AWS maintains the AWS Secrets and Configuration Provider (ASCP), which mounts secrets as files in the pod (the official example uses /mnt/secrets-store) based on a SecretProviderClass. ESO follows a different model: it creates a Kubernetes Secret, consumed through envFrom, a volume, or any Helm chart that already expects a Secret.
In practice:
- Use ESO when your applications and third-party charts already consume a native
Secretand you want a single declarative workflow, including across multiple clouds. - Consider ASCP when the requirement is not to persist the value as a
Secretin the cluster and consumption through a mounted file works for the application.
In both cases, AWS Secrets Manager remains the source of truth.
Step by step: installing ESO on Amazon EKS
1. Install the operator via Helm
helm repo add external-secrets https://charts.external-secrets.io
helm install external-secrets external-secrets/external-secrets \
-n external-secrets --create-namespace
In production, pin the chart version (--version <versao>) and promote upgrades across environments. By default, the chart installs and manages the CRDs; to manage them outside the release, use --set installCRDs=false.
Heads up: the documentation warns that the CRDs have reached the 256 KB limit and require server-side apply. In a GitOps workflow, such as the one described in ArgoCD with Helm, enable server-side apply for the application that delivers the CRDs.
2. Create the controller's IAM role with EKS Pod Identity
EKS Pod Identity associates an IAM role with a service account without an annotation and without a per-cluster OIDC provider. According to the AWS documentation, it requires the Amazon EKS Pod Identity Agent add-on, is only available for EKS in the AWS cloud, and, in private clusters, depends on an AWS STS VPC endpoint.
Trust policy for the role:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Service": "pods.eks.amazonaws.com" },
"Action": ["sts:AssumeRole", "sts:TagSession"]
}
]
}
Read policy, restricted by name prefix (based on the example in the provider documentation):
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:ListSecrets",
"secretsmanager:BatchGetSecretValue"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetResourcePolicy",
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret",
"secretsmanager:ListSecretVersionIds"
],
"Resource": "arn:aws:secretsmanager:<regiao>:<conta>:secret:prod/*"
}
]
}
If the secrets use a customer managed KMS key, the role also needs kms:Decrypt on that key.
3. Associate the role with the operator's service account
aws eks create-pod-identity-association \
--cluster-name <cluster> \
--role-arn arn:aws:iam::<conta>:role/eso-controller \
--namespace external-secrets \
--service-account external-secrets
Prefer declaring the association in IaC (Terraform/OpenTofu) alongside the role, to keep the binding auditable.
4. Declare the SecretStore
With Pod Identity, the store has no auth block: the controller uses the identity of its own pod.
apiVersion: external-secrets.io/v1
kind: SecretStore
metadata:
name: aws-secrets-manager
namespace: pagamentos
spec:
provider:
aws:
service: SecretsManager
region: sa-east-1
Documented limitation: auth.jwt.serviceAccountRef cannot be combined with Pod Identity, because ESO cannot impersonate service accounts bound through that mechanism. For per-store identity, use the role field (next section) or the IRSA model.
5. Declare the ExternalSecret
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: api-pagamentos
namespace: pagamentos
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secrets-manager
kind: SecretStore
target:
name: api-pagamentos
creationPolicy: Owner
data:
- secretKey: DB_PASSWORD
remoteRef:
key: prod/pagamentos/db
property: password
The property field navigates JSON secrets using gjson syntax (password, usuario.nome). To pull all the keys of a JSON secret at once, use dataFrom.extract.key. The remoteRef.version field accepts a version stage, such as AWSCURRENT or AWSPREVIOUS.
6. Validate the sync
kubectl get secretstore,externalsecret -n pagamentos
kubectl describe externalsecret api-pagamentos -n pagamentos
The store should report the Ready condition, and the ExternalSecret events indicate permission errors or missing keys.
Least privilege per namespace: role per store and session tags
A single role with broad read access, shared by every namespace, is the most common mistake. Any team that can create an ExternalSecret can then read any secret the role can reach. The ESO documentation recommends limiting access per store with the role field: the controller calls sts:AssumeRole into a specific role before reading.
spec:
provider:
aws:
service: SecretsManager
region: sa-east-1
role: arn:aws:iam::<conta>:role/eso-pagamentos
sessionTagsPolicy: Simple
With sessionTagsPolicy: Simple, ESO adds the esoNamespace, esoStoreName, and esoStoreKind tags to the session. This enables attribute-based access control (ABAC): a single policy that grants access only to secrets whose tag matches the store's namespace, following the pattern AWS describes in its article on ABAC with Secrets Manager on EKS:
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret",
"secretsmanager:ListSecretVersionIds"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"secretsmanager:ResourceTag/namespace": "${aws:PrincipalTag/esoNamespace}"
}
}
}
The trust policy of the target role must allow sts:TagSession for the controller's role. Validate the behavior in a test environment before taking it to production.
Complementary measures on the Kubernetes side:
- Use RBAC to restrict who can create
SecretStoreandExternalSecret. - If you use
ClusterSecretStore, treat it as a platform resource, not a team resource. - Confirm envelope encryption of Secrets with AWS KMS on the EKS cluster and, if your security policy requires it, use a customer managed key: the content of a
Secretis only base64-encoded, not encrypted by the API.
Rotation, availability, and cost
Rotation. ESO queries the provider every refreshInterval and updates the Secret. This does not restart the pods: environment variables are not updated in running containers, while mounted volumes reflect the new value after some time. Define in the design how the application reloads credentials (file read, automated rollout, or reconnection).
Availability. Secrets that have already been synced remain in the cluster if the controller or the AWS API becomes unavailable; the impact is a delay in propagating new values. Monitor the operator like any other platform component: the documentation provides a metrics page in Prometheus format, the basis for sync failure alerts in Grafana.
Cost (FinOps). AWS Secrets Manager charges per secret stored and per API call; creating new versions during rotation does not incur additional charges. With ESO, the call volume is a function of the number of ExternalSecret resources and the refreshInterval. Three things to watch:
- Avoid intervals measured in seconds unless you need them; align the
refreshIntervalwith the rotation policy. - Group related keys into a JSON secret and use
dataFrom.extract, instead of one secret per variable. - For lookups by name, the documentation states that, without a
pathprefix, the operator falls back toListSecretsplus one call per secret, which costs more than usingBatchGetSecretValue.
Frequently asked questions
Does the External Secrets Operator store the secret in the cluster?
Yes. The result is a native Kubernetes Secret, persisted in etcd. That is why envelope encryption with KMS and restrictive RBAC are still required.
Can I use IRSA instead of EKS Pod Identity?
Yes. ESO accepts auth.jwt.serviceAccountRef pointing to a service account with the eks.amazonaws.com/role-arn annotation. What does not work is combining that field with service accounts bound through Pod Identity.
Does ESO also write secrets to AWS Secrets Manager?
Yes, with the PushSecret resource, which requires write permissions (CreateSecret, PutSecretValue, among others). Keep those permissions in a role separate from the read role.
Conclusion
The External Secrets Operator takes the secret out of Git without taking the cluster out of GitOps: the repository declares the reference, AWS Secrets Manager holds the value, and the pod's identity replaces static keys. The real gain shows up when the design includes a role per store, tags for ABAC, encryption in etcd, a reload strategy, and sync alerts.
CloudScript implements this pattern on Kubernetes platforms as part of its DevSecOps and Platform Engineering services, with declarative delivery, observability, and 24/7 support for customers under contract. If you want to review secrets management in your environment, get in touch or write to contato@cloudscript.com.br.
Sources
- External Secrets Operator — Getting started
- External Secrets Operator — AWS Access
- External Secrets Operator — AWS Secrets Manager
- External Secrets Operator — SecretStore
- External Secrets Operator — Metrics
- AWS Secrets Manager — ASCP with Pod Identity for Amazon EKS
- AWS Security Blog — Secrets Manager and ABAC on Amazon EKS
- AWS Secrets Manager — Pricing
- Kubernetes — Secrets
AWS, Amazon EKS, and AWS Secrets Manager are trademarks of Amazon.com, Inc. or its affiliates. Kubernetes and Helm are trademarks of The Linux Foundation. All other trademarks belong to their respective owners. Use is nominative only and does not imply endorsement.



