Jay:
I have a question of injecting configmap to a pod in a definition yaml file
In the lecture I was told to do
...
spec:
containers:
...
envFrom:
- configMapRef:
name: app-config
But in the official document https://kubernetes.io/docs/concepts/configuration/configmap/
...
spec:
containers:
- name: demo
image: alpine
command: ["sleep", "3600"]
env:
# Define the environment variable
- name: PLAYER_INITIAL_LIVES # Notice that the case is different here
# from the key name in the ConfigMap.
valueFrom:
configMapKeyRef:
name: game-demo # The ConfigMap this value comes from.
key: player_initial_lives # The key to fetch.
Is there a difference between env
and envFrom
?