Kubernetes ConfigMap Simulation
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
database.url: postgres://postgres:password@db:5432/mydb
api.key: abc123xyz456
cache.enabled: true
log.level: info
ConfigMap Data:
Add New Entry:
Pods in the Cluster
web-pod-1
Running
api-pod-1
Running
worker-pod-1
Running
How ConfigMaps Work
- ConfigMaps store configuration data as key-value pairs
- Pods can consume ConfigMaps as environment variables or file mounts
- When a ConfigMap changes, Pods need to restart to pick up changes
- ConfigMaps are not intended for sensitive data (use Secrets instead)