1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-15 17:51:01 +00:00
external-secrets/docs/snippets/template-v2-literal-example.yaml
Robert Paschedag 45e2bd3796
added some example for v2 literal templating (#3007)
Signed-off-by: Robert Paschedag <robert.paschedag@sap.com>
Co-authored-by: Robert Paschedag <robert.paschedag@sap.com>
2024-01-09 09:38:23 +01:00

23 lines
562 B
YAML

{% raw %}
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: my-template-example
spec:
# ...
target:
name: secret-to-be-created
template:
engineVersion: v2
templateFrom:
- target: Data
literal: |-
{{- $creds := list }}
{{- range $user, $pw := . }}
{{- $creds = append $creds (printf "%s" (htpasswd $user $pw)) }}
{{- end }}
auth: {{ $creds | join "\n" | quote }}
dataFrom:
- extract:
key: /ingress-controller/valid-users
{% endraw %}