Env or envFrom - From CKA exam perspective, when do I use which one

Hi,

Which one do I use to define the environment variables in the Pod which are either secrets or configmaps
Will they validate either options in exam unless explicitly asked, because I have seen it’s not the case with kk labs

Thanks in advance!!

Hi Rashmitha_MN,

  • Use envFrom when you want to import all environment variables from a ConfigMap or Secret without listing each key manually.
  • Use env when you need more control over individual environment variables, especially if you need to reference specific keys.
2 Likes