ConfigMap spec.containers.env:
env:
- name: APP_COLOR
valueFrom:
configMapKeyRef:
name: my-cm # The ConfigMap containing the value you want to assign to APP_COLOR
key: color # Specify the key associated with the value
Use spec.containers.envFrom to define all of the ConfigMap's data as container environment variables. The key from the ConfigMap becomes the environment variable name in the Pod:
envFrom:
- configMapRef:
name: special-config
Add the ConfigMap data as files to the directory specified as spec.containers.volumeMounts.mountPath.volumes:
- name: config-volume
configMap:
# Provide the name of the ConfigMap containing the files you want
# to add to the container
name: special-config
spec.containers.volumeMounts:
volumeMounts:
- name: config-volume
mountPath: /etc/config