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
Read this lesson in your language
All lessons in this course
14 lessons- 1What is Kubernetes25 min
- 2Your First Pod30 min
- 3Deployments and ReplicaSets35 min
- 4Services35 min
- 5Probes and Self-Healing35 min
- 6ConfigMaps and Secrets35 min
- 7Volumes and Persistent Storage35 min
- 8Namespaces and Labels25 min
- 9Ingress35 min
- 10Helm Basics35 min
- 11Scaling and HPA30 min
- 12RBAC35 min
- 13Observability30 min
- 14Capstone: Deploy a Stack60 min
