vault-helm: helm template: function "secret" not defined
The recommended annotation for templating a secret, as suggested in your docs, results in helm templating error. It works fine when running kubectl apply but helm tries to interpret the templating language instead of a string literal
annotations:
vault.hashicorp.com/agent-inject-template-account: |
{{- with secret "path/to/secret" -}}
{{ .Data.test }}
{{- end }}
Whats the right approach to be able to run that in helm? I am using helm 3.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 16 (1 by maintainers)
The fix iis to remove the space between }} and `
am i the only one who thinks this a complex way of injecting secrets? third parties have for a long time already taken advantage of admission webhooks and injecting secrets into a pod. e.g. this
ultimately hashicorp will need to revisit this sticking point
@elnoxgdl try with
Hey @ekhaydarov, this should work:
Thanks dude. it helped me atleast.
lint returns this error
unable to parse YAML: error converting YAML to JSON: yaml: line 34: did not find expected keyin my case, I wanted to iterate over a list of secrets and auto template each of them where secrets list might look like