ConfigMaps and Secrets
Part of the Kubernetes course
Right now, if your container needs a setting, such as a log level or a database username, the only place to put it is baked into the image itself. That works until the day you need a different value in staging than in production, or a different value for every developer's own test cluster.
Kubernetes gives you two objects that solve this by keeping configuration outside the image entirely and handing it to the container at run time instead. A ConfigMap holds configuration that is fine to see in plain text, things like a greeting message or a log level. A Secret holds the same kind of thing for values you do not want sitting around in plain text, like passwords or API tokens.
Want to learn Kubernetes ConfigMaps and Secrets in a real environment?
Click below, get a fresh Linux box with Kubernetes ready to go, and work through ConfigMaps and Secrets hands-on with an AI tutor that knows your code.
Start this lessonConfigMaps and SecretsWhat you'll learn
- ConfigMap manifest
- EnvFrom
- Mount as file
- Secret base64
- Kubectl create secret generic
- Never commit real secrets
