Tous les labs

Inject configuration and a Secret

Starter ~18 mink8s

Configure api deployment in namespace app using MODE=production and a database password without baking either value into the image.

Objectifs
  • Create ConfigMap api-config with MODE=production
  • Create Secret db-creds with password=s3cur3
  • Reference both from Deployment api
Étapes suggérées
  1. Create each data object imperatively.
  2. Use valueFrom with configMapKeyRef and secretKeyRef.
  3. Inspect the Pod environment definition.
Indices
Voir la solution
kubectl create configmap api-config -n app --from-literal=MODE=production
kubectl create secret generic db-creds -n app --from-literal=password=s3cur3
# Add env.valueFrom references to the Deployment and apply.