In this section, we will take a look at configuring configmaps in applications
$ kubectl create configmap app-config --from-literal=APP_COLOR=blue --from-literal=APP_MODE=prod
$ kubectl create configmap app-config --from-file=app_config.properties (Another way)
The Declarative way
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
APP_COLOR: blue
APP_MODE: prod
Create a config map definition file and run the 'kubectl create` command to deploy it.
$ kubectl create -f config-map.yaml
## View ConfigMaps
$ kubectl get configmaps (or)
$ kubectl get cm
$ kubectl describe configmaps
## ConfigMap in Pods
apiVersion: v1 kind: ConfigMap metadata: name: app-config data: APP_COLOR: blue APP_MODE: prod
$ kubectl create -f pod-definition.yaml ```
#### There are other ways to inject configuration variables into pod
Single Environment Variable
You can inject it as a file in a Volume
#### K8s Reference Docs