Skip to content
StackDecode
BeginnerLesson 8 of 35

ConfigMaps

Keep configuration out of the image.

yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  LOG_LEVEL: info
  app.properties: |
    mode=fast
yaml
# in the pod spec
envFrom:
  - configMapRef: { name: app-config }
volumes:
  - name: cfg
    configMap: { name: app-config }

Environment variables are read at container start. Files mounted from a ConfigMap update automatically (after a short delay); the app has to re-read them.