Configuring applications
Configuring an application is a simple and straightforward experience thanks to ConfigMaps and Secrets. Let’s take a look at each of them.
Understanding ConfigMaps
A ConfigMap is simply a Kubernetes object that stores configuration data in key-value pairs. This configuration data can then be used to configure the software running in a container by configuring a pod to consume ConfigMaps using environment variables, command-line arguments, or mounting a volume with configuration files.
You can also use a YAML definition to define configmap
as follows:
apiVersion: v1
kind: ConfigMap
metadata:
name: melon-configmap
data:
myKey: myValue
myFav: myHome
Your output should look as follows:
configmap/melon-configmap created
You can check configmap
using the following command:
kubectl get configmap...