Skip to content

Commit

Permalink
Add volumes and env vars to helm hook test pod
Browse files Browse the repository at this point in the history
 - Uses the same extraEnvironmentVars, volumes and volumeMounts set on
   the server statefulset to configure the Vault server test pod used by
   the helm test hook
 - This is necessary in situations where TLS is configured, but the
   certificates are not affiliated with the k8s CA / part of k8s PKI

 - Fixes hashicorpGH-665
  • Loading branch information
Iristyle committed Jan 7, 2022
1 parent 0043023 commit ab6813f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion templates/tests/server-test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ template "vault.mode" . }}
{{- if .Values.server.enabled }}
apiVersion: v1
kind: Pod
Expand All @@ -15,6 +16,7 @@ spec:
env:
- name: VAULT_ADDR
value: {{ include "vault.scheme" . }}://{{ template "vault.fullname" . }}.{{ .Release.Namespace }}.svc:{{ .Values.server.service.port }}
{{- include "vault.extraEnvironmentVars" .Values.server | nindent 12 }}
command:
- /bin/sh
- -c
Expand All @@ -35,6 +37,9 @@ spec:
fi
exit 0
volumeMounts:
{{ template "vault.mounts" . }}
volumes:
{{ template "vault.volumes" . }}
restartPolicy: Never
{{- end }}

0 comments on commit ab6813f

Please sign in to comment.