Vault is integrated with K8s cluster as side car and this cluster is deployed by using helm chart. As a part of helm chart below is code :
vault.hashicorp.com/agent-inject-template-dbsecret: |
{{`{{- with secret "path" -}}
export USER="{{ .Data.data.user }}"
export PASSWORD="{{ .Data.data.password }}"
{{- end }}`}}
Now it is required to use same helm chart for different environment and per environment path can be different so planning to store it in values file and use it here.
Tried with {{ .Values.secretPath }} but value is not getting populated.
vault.hashicorp.com/agent-inject-template-dbsecret: |
{{`{{- with secret "{{ .Values.secretPath }}" -}}
export USER="{{ .Data.data.user }}"
export PASSWORD="{{ .Data.data.password }}"
{{- end }}`}}
I would like to know how can i keep this path values as dynamic and pass it from values file so same chart can be used in different environment.
Thanks in advance.