Services

Resources

Company

/

External Secrets Operator

External Secrets Operator (ESO)

External Secrets Operator (ESO) is a Kubernetes operator that copies secrets from an external secret manager, such as HashiCorp Vault, AWS Secrets Manager, Google Secret Manager or Azure Key Vault, into ordinary Kubernetes Secrets. The password lives in the secret manager, the cluster gets a copy that ESO keeps up to date, and no secret value is committed to Git.

How it works

ESO adds two main custom resources. A SecretStore, or the cluster-wide ClusterSecretStore, says how to reach a provider and authenticate to it, for example Vault with Kubernetes auth. An ExternalSecret says which remote keys to fetch, which Kubernetes Secret to write and how often to refresh. The controller reconciles each ExternalSecret on that interval and creates or updates the target Secret.

Exercise 7 of the One2N SRE bootcamp runs Vault in the cluster as the secret store for ESO. In a setup like that, an ExternalSecret with refreshInterval: 1h and a secretStoreRef pointing at the Vault SecretStore maps property password of Vault key db to DB_PASSWORD in Secret student-api-db. ESO checks Vault 24 times a day, so a rotated password reaches the Secret within an hour, and the API pod reads it through secretKeyRef.

Why it matters in production

ESO gets the secret into the cluster; it does not make it safe there. A Kubernetes Secret is base64-encoded, not encrypted, so limit who can read Secrets with role-based access control and turn on encryption at rest for etcd. Environment variables are read once at container start, so pods need a restart, or a mounted volume, to pick up a rotated value. Watch the ExternalSecret's Ready condition as well: if ESO loses access to the store, the last synced Secret stays in place and nothing fails until the password changes.

See also

On the One2N blog

References

  1. External Secrets Operator documentation

  2. HashiCorp Vault provider (External Secrets Operator documentation)

  3. Secrets (Kubernetes documentation)

Swimlane timeline of External Secrets Operator over six hours, with refreshInterval: 1h. Vault key db holds the old password until it is rotated at about 2.4 hours. ESO checks Vault every hour, so the Kubernetes Secret switches to the new password at the 3 hour check. The pod read its env var once at start, so its lane stays on the old password, shown in red as still old until restart. One check an hour = 24 a day.

Putting this into practice?

Talk to One2N about our platform engineering services

Talk to One2N about our platform engineering services