Search⌘ K

Injecting Configurations from Environment Files

Explore how to inject configurations into Kubernetes deployments using environment files. Understand the differences between --from-env-file, --from-literal, and --from-file arguments for creating ConfigMaps and practice managing key/value pairs for flexible configuration.

Looking into the definition

Let’s take a look at the my-env-file.yml file.

Shell
something=else
weather=sunny

The file has the same key/value pairs as the ones we used in the example with --from-literal.

Creating the ConfigMap

Let’s see what happens if we create a ConfigMap using that file as ...