feat: add vault

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-05-23 21:34:28 +02:00
parent 50d85ed383
commit 0d14152edf
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394

View File

@ -26,13 +26,13 @@ spec:
envFrom:
- configMapRef:
name: {{service_name}}-config
{%- if vars.vault_secret is defined and (vars.vault_secret.secrets | length) > 0 %}
{%- if vars.vault_secret.has_values %}
env:
{%- for secret in vars.vault_secret.secrets %}
- name: {{secret | upper | replace(".", "_") | replace("-", "_") }}
valueFrom:
secretKeyRef:
name: {{ service_name }}-{{ vars.vault_secret.name }}
name: {{ vars.vault_secret.file_name(service_name) }}
key: {{ secret }}
{%- endfor %}
{%- endif %}