Wire a ConfigMap and roll it safely

  • 12 min
  • 6 steps
  • Config, storage and state

Steps

0 of 6 done

Unstick a Deployment waiting on its ConfigMap, then ship a configuration change as an immutable, versioned ConfigMap and a rollout.

  1. Step 1 of 6

    The two storefront pods have sat in ContainerCreating since the Deployment was applied. Find the event that says what they are waiting for.

    Checked against what your commands print.

  2. Step 2, not started: Create the ConfigMap the pods expect: storefront-config, with the file config.yaml from your working directory under the key config.yaml, and a key LOG_LEVEL set to info. Wait until both pods are ready.

  3. Step 3, not started: From inside a running storefront pod, print the value of LOG_LEVEL the container received.

  4. Step 4, not started: Ship LOG_LEVEL=debug without touching storefront-config. Create storefront-config-v2 with the same config.yaml and LOG_LEVEL set to debug, and make it immutable.

  5. Step 5, not started: Point the Deployment at storefront-config-v2, both the LOG_LEVEL reference and the config volume, and let the rollout finish.

  6. Step 6, not started: A rollback returns to an earlier revision's pod template. Print the pod template of revision 1 and find the ConfigMap it references, the configuration kubectl rollout undo would bring back.

Lab terminal

Cluster time 50 seconds
kind cluster kx, Kubernetes 1.37.
Each step is checked as you work.
​
Tab completes. Up and Down recall.
Type help for more.
Terminal keys

Enter runs the command. Tab completes, and the arrow keys recall earlier commands. Control C stops a watch. On an empty line, or after Escape, Tab moves focus out of the terminal.