2

I have a kubeconfig yaml file which contains the property "ENABLED" in env. There is a secrets file being read using envFrom as well which also contains the property "ENABLED". Which one will get picked up at runtime?

env:
   - name: ENABLED
     value: "true"                
envFrom:
  - secretRef:
    name: test
Bash
  • 4,140
  • 1
  • 13
  • 8

1 Answers1

4

The kubernetes documentation of envFrom states that:

... Values defined by an Env with a duplicate key will take precedence. ...

Thus, the value defined by env will take precedence.

The answer was take from nightfury1204's answer of this question.

Turing85
  • 18,217
  • 7
  • 33
  • 58
  • And if multiple envFrom entries are specified that contain the same env var, the last one will take precedence. > 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 – dataviruset Jun 09 '22 at 10:45