custom-hashicorp-vault-helm/templates/vault-hashicorp-secret.yaml
Alan Bridgeman 106235c29d
All checks were successful
Deploy the Helm Chart / build (push) Successful in 10s
Forgot to remove a .vault. (unneccessary root key) from one of the conditionals in a template again... :)
2025-12-19 17:39:35 -06:00

24 lines
No EOL
1.1 KiB
YAML

{{- if and (.Values.enabled) (eq .Values.type "hashicorp") -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "vault.fullname" . }}-secret
type: opaque
data:
{{- if .Values.create.enabled }}
# Because we create the Hashicorp Vault instance as part of the Helm chart,
# we can use the name of the created resource (utilizing k8s built-in container connections)
# to connect to the Vault instance without having to hard-code the Vault name.
vault-name: {{ include "vault.fullname" . | b64enc }}
# Because we create the Hashicorp Vault instance as part of the Helm chart,
# We know the port that the Vault instance is running on.
vault-port: {{ printf "%d" 80 | b64enc }}
{{- else }}
# Because the Vault wasn't created as part of the Helm chart,
# we need the deployer to specify the name of the Vault instance to connect to.
vault-name: {{ .Values.vaultName | b64enc }}
# Because the Vault wasn't created as part of the Helm chart,
# we need the deployer to specify the port that the Vault instance is running on.
vault-port: {{ .Values.vaultPort | b64enc }}
{{- end }}
{{- end -}}