Secret Refresh and Sync Policies
What you'll learn: How to control how often the External Secrets Operator checks for and updates secrets from external providers.
When you connect Kubernetes to an external secret store like AWS Secrets Manager or Vault, you need to decide how the External Secrets Operator keeps your secrets current. Should it check for updates every minute? Every hour? Only once? This is where refresh and sync policies come in.
Why Refresh Matters
Think of external secrets like checking your mailbox. If you never check it, you'll miss important updates. But checking every second wastes time and energy. The refresh interval tells the operator how frequently to poll the external provider for changes.
In an ExternalSecret manifest, you configure this with the refreshInterval field:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: my-external-secret
spec:
refreshInterval: 15m # Check every 15 minutes
secretStoreRef:
name: my-secret-store
kind: SecretStore
target:
name: my-k8s-secret
data:
- secretKey: password
remoteRef:
key: prod/db/password
Sync Behavior
When the operator detects a change in the external provider, it automatically updates the corresponding Kubernetes Secret. Your mounted secrets in pods will reflect changes according to the ConfigMap Volume Auto-Update behavior you learned earlier—typically within a minute or two for volume mounts, but requiring pod restarts for environment variables.
Setting refreshInterval: 0 disables automatic refresh—secrets sync only once at creation.
Key Takeaway: The refreshInterval field in ExternalSecret resources controls how often Kubernetes checks external providers for secret updates, balancing freshness against API rate limits and performance.