Skip to content

CICD-280 · ConfigMap generation ​

Encyclopedia · Advanced Kubernetes operations · All snippets

Previous · CICD-279 · Next · CICD-281

1. Where it fits ​

  • Placement CI render step.
  • Prerequisites kubectl, isolated cluster or namespace and installed CRDs when named.
  • Platforms kubernetes, local-lab.

2. Copy the snippet ​

bash
kubectl -n staging create configmap web-config --from-file=app.toml --dry-run=client -o yaml > configmap.yaml
kubectl apply --dry-run=server -f configmap.yaml

3. How it works ​

Client dry run renders a candidate object locally so it can be reviewed or piped into a separate apply. Server-side dry run sends the candidate through API validation and admission without persisting the change.

4. Verify the result ​

Provide a reviewed non-secret app.toml. Use a rollout mechanism if the process reads environment variables only at startup.

Validation syntax-validated (Bash parse). Status definitions.