I didn't find any information about priority of configMaps vs secrets. If I have the same keys in both, which one wins?
Here's an example of a template:
spec:
containers:
- envFrom:
- configMapRef:
name: my-configmap
- secretRef:
name: my-secret
CodePudding user response:
According to the kubernetes code, it iterates over the list in sequence.
func (b *ContainerApplyConfiguration) WithEnvFrom(values ...*EnvFromSourceApplyConfiguration) *ContainerApplyConfiguration {
for i := range values {
.
.
So the order matters, whatever comes later in the list will overwrite the previous value. In the example you provided, the value from my-secret
will win.