From the course: Kubernetes: Microservices
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Adding context with configmaps - Kubernetes Tutorial
From the course: Kubernetes: Microservices
Adding context with configmaps
- [Narrator] Configuration Information should live outside of the application. How can we do this in Kubernetes and how is it implemented? Kubernetes gives us a construct called ConfigMaps that helps us implement this feature. There's two ways to do this, either you can pass in data via environment variables for small sets of data or for larger pieces of data you can use it as a volume mount. In the simple scenario in this example I have a configmap a time configmap EPI version v1 and we're going to call it log-config and the actual data associated with this is log-level of debug. So this is the definition of the configmap now when we want to execute this in the container we first need to volume mount that, so we put volume of config-volume and configmap with name of log-config, which is the information that we had pulled in before. And to see this inside of the container, we're going to pass this in as an environment variable, we'll call it log-level and the value comes from…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.