I have dozens of secrets to pass into a k8 deployment which becomes very verbose, bellow is an example of passing the redis secrets in from the redis-secrets
secret.
- name: REDIS_HOST
valueFrom:
secretKeyRef:
name: redis-secrets
key: REDIS_HOST
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-secrets
key: REDIS_PASSWORD
- name: REDIS_PORT
valueFrom:
secretKeyRef:
name: redis-secrets
key: REDIS_PORT
Is it possible to pass all the secrets from redis-secrets
into the deployment, with the keys of the secrets being the env variable key?
I used this for configmaps.
Same level as env which is .spec.containers
:
envFrom:
- secretRef:
name: redis-secrets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With