k8s config map how to apply

10/4/2018

i've a question i create my config map but i dont know how to apply them to k8s ? if i execute the command

kubectl get configmap configmap-cas-properties -o yaml

i can see my configmap. However i cant find any information on how to add it to k8s .

I going to use it with my pod where i already set

 envFrom:
       - configMapRef:
           name: configmap-cas-app-properties
           name: configmap-cas-properties    restartPolicy: never
-- morla
google-kubernetes-engine
kubernetes

1 Answer

10/4/2018

The ConfigMaps can be set as Environment variables which can be read in the application. Another way is to mount the ConfigMaps as a Volume in the Container and the application read the data from there. Here is the documentation from K8S on the same.

-- Praveen Sripati
Source: StackOverflow