Workload Type
Deployment
Stateless applications (web servers, APIs)
StatefulSet
Stateful applications (databases, caches)
CronJob
Scheduled batch tasks
The Kubernetes ConfigMap Generator safely decouples environment variables from container images. It scaffolds key-value pairs into consumable volume mounts or environment injections.
Step 1: Add Variables - Input the keys and values for your configuration data.
Step 2: Select Injection Strategy - Choose whether the data should be injected as environment variables or mounted as a file.
Step 3: Generate YAML - Export the ConfigMap manifest.
Hardcoding configuration data directly into Docker images violates the core principles of Twelve-Factor apps and makes images entirely non-portable across environments (dev vs staging vs prod). A ConfigMap solves this by storing non-confidential data in the cluster. However, ensuring that the Deployment manifest correctly references the ConfigMap keys is tedious. Our tool ensures the exact data structure is generated, preventing container crashes caused by missing configuration bindings.
Decoupling configuration from code requires externalizing variables into cluster-native ConfigMaps.
| Configuration Key | Default Behavior | Production Best Practice |
|---|---|---|
| Data Storage | Hardcoded in Dockerfile | Externalized in ConfigMap |
| Injection | Manual env vars | envFrom: configMapRef |
| Updates | Requires image rebuild | Hot-reloaded via volume mounts |
Here is a real generated snippet matching the production best practices above:
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config