when we use envFrom to inject comlete configmap to our pod, envFrom should come as an array or as an object? I check kubecnetes documentation, there they are using envFrom as object :
while when I was doing lab exercise there I got error as it expect envFrom as array and same I saw in solution video too.
Also what’s the difference in both approach? How to decide if we need to use envFrom as an array or as an object?
envFrom as array
EnvFrom is a list of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Immutable.
envFrom[] as object
EnvFromSource represents the source of a set of ConfigMaps
my appologies but I didn’t understand the above reply. Also when I was doing lab for secret there we used envFrom as object. So I am still confused how to decide if envFrom need to be use as an array or as on object.