Overview
The kit uses External Secrets Operator to sync secrets from AWS Secrets Manager into Kubernetes. This keeps sensitive data out of Git while providing a GitOps-friendly secret management workflow.Architecture
- ClusterSecretStore - Configures access to AWS Secrets Manager (one per cluster)
- ExternalSecret - Defines which secrets to fetch and how to map them
- Secret - The Kubernetes Secret created and kept in sync
Prerequisites
The External Secrets Operator uses Pod Identity to authenticate to AWS. This is configured automatically by the EKS Terraform module. Verify the ClusterSecretStore is working:Create a Secret in AWS
1
Create the secret in Secrets Manager
Using AWS CLI:Or using the AWS Console:
- Navigate to Secrets Manager
- Click “Store a new secret”
- Choose “Other type of secret”
- Enter key/value pairs or plaintext
- Name it following the naming convention
2
Create the ExternalSecret manifest
Create
ExternalSecret.myapp-secrets.yaml in your service’s templates:3
Deploy and verify
Secret Naming Conventions
The kit uses CloudPosse null-label for consistent resource naming. Secrets follow the same pattern:| Component | Description | Examples |
|---|---|---|
namespace | Organization abbreviation | ksk (kube-starter-kit), myco, etc. |
environment | AWS region abbreviation | use2 (us-east-2), use1 (us-east-1), gbl (global) |
stage | Deployment stage | staging, prod, shared |
name | Descriptive secret name | myapp-db, argocd-github-dex, signoz-ingestion-key |
The examples below use
ksk as the namespace (the kit’s default). Replace this with the namespace you configured during Bootstrap Accounts.ksk-use2-staging-myapp-db- Database credentials for myappksk-use2-staging-argocd-github-dex- ArgoCD GitHub OAuth credentialsksk-use2-staging-signoz-ingestion-key- SigNoz observability ingestion key
- Aligns with all other Terraform-managed resources
- Makes secrets easy to identify by cluster/environment
- Enables fine-grained IAM policies using prefixes
- Avoids naming conflicts across environments
Fetch Multiple Values from One Secret
AWS Secrets Manager secrets can contain JSON with multiple key/value pairs:1
Create a JSON secret
2
Extract specific keys
Use Secrets in Pods
Reference the synced Secret in your Deployment:Refresh and Sync Behavior
Automatic Refresh
ExternalSecrets periodically refresh from AWS based onrefreshInterval:
Force Refresh
To immediately sync a secret:Reloader Integration
The kit includes Reloader, which automatically restarts pods when their Secrets change:Environment-Specific Secrets
Use different secret paths for each environment:IAM Permissions
The External Secrets service account needs permission to read secrets. This is configured via Pod Identity in the EKS Terraform module. By default, the External Secrets Pod Identity role has access to all secrets (arn:aws:secretsmanager:*:*:secret:*). To restrict access to specific prefixes, update the policy in terraform/modules/eks/base-infra-resources.tf:
Next Steps
- Database Operations - Manage database credentials
- Bootstrapping a New Service - Add secrets for new services