https://drive.google.com/file/d/10W-FxaK9hp92ogW4l5q9LusTY0Hc_LwX/view?usp=sharing
A set of real-world, battle-tested practices for using ConfigMaps & Secrets safely and efficiently in production Kubernetes clusters.
โ Goal: Avoid common pitfalls, ensure security, and enable smooth operations.
Like following building codes for a skyscraper โ not glamorous, but keeps everything safe, maintainable, and compliant.
Step 1: Store secrets in a secure vault (e.g., HashiCorp Vault)
โ Never in Git.
Step 2: Use External Secrets Operator (ESO) to sync to Kubernetes
# external-secret.yaml
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
meta
name: prod-db-secret
namespace: app-prod
spec:
secretStoreRef:
name: vault-backend
kind: ClusterSecretStore
target:
name: db-creds # โ Creates a Kubernetes Secret
data:
- secretKey: password
remoteRef:
key: prod/db
property: password
Step 3: Use the synced Secret in your app
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-creds
key: password
โ Result: