OpsCanary
Back to daily brief
securitysecretsPractitioner

Mastering Secrets Management with External Secrets Operator

5 min read External Secrets DocsApr 21, 2026
PractitionerHands-on experience recommended

In modern cloud-native applications, managing secrets securely is a challenge that can lead to significant vulnerabilities if not handled correctly. The External Secrets Operator (ESO) exists to bridge the gap between Kubernetes and external secret management systems, such as AWS Secrets Manager. By doing so, it allows you to maintain a clean separation between your application code and sensitive data, reducing the risk of exposure.

The ESO operates by reconciling ExternalSecrets through a specific mechanism. It uses the spec.secretStoreRef to identify the appropriate SecretStore. If the SecretStore is missing or the controller field doesn't match, the ESO halts further processing of that ExternalSecret. Once validated, it instantiates an external API client using credentials defined in the SecretStore spec. The ESO fetches the requested secrets, decodes them if necessary, and creates a Kubernetes Secret based on the template provided in the ExternalSecret's target.template. This ensures that your secret values remain in sync with the external API, simplifying secret management across your workloads.

In production, you need to be aware of a few critical considerations. First, there is no built-in Secret Operator to manage the lifecycle of the secrets, which means you must handle that separately. Additionally, carefully design your SecretStore and ClusterSecretStore to restrict access appropriately, especially in shared environments. Consider implementing Kubernetes' admission control systems like OPA Kyverno for fine-grained access control to enhance security further.

Key takeaways

  • Understand the role of SecretStore to separate authentication from secret management.
  • Use `spec.secretStoreRef` in ExternalSecrets to link to the correct SecretStore.
  • Be aware that ESO does not manage the lifecycle of secrets; plan accordingly.
  • Design your ClusterSecretStore with strict access controls to protect sensitive data.
  • Implement admission control systems for enhanced security and access management.

Why it matters

Effective secrets management is critical for maintaining security in production environments. The ESO allows teams to automate secret fetching and syncing, reducing human error and potential exposure of sensitive data.

Code examples

YAML
1apiVersion:external-secrets.io/v1
2kind:SecretStore
3metadata:
4  name: secretstore-sample
5spec:
6  provider:
7    aws:
8      service: SecretsManager
9      region: us-east-1
10  auth:
11    secretRef:
12      accessKeyIDSecretRef:
13        name: awssm-secretkey
14        key: access-key
15      secretAccessKeySecretRef:
16        name: awssm-secretkey
17        key: secret-access-key
YAML
1apiVersion:external-secrets.io/v1
2kind:ExternalSecret
3metadata:
4  name: example
5spec:
6  refreshInterval: 1h0m0s
7  secretStoreRef:
8    name: secretstore-sample
9    kind: SecretStore
10  target:
11    name: secret-to-be-created
12    creationPolicy: Owner
13  data:
14    - secretKey: secret-key-to-be-managed
15      remoteRef:
16        key: provider-key
17        version: provider-key-version
18        property: provider-key-property
19  dataFrom:
20    - extract:
21        key: remote-key-in-the-provider

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.