added possibility to add extraLabels for server pod (#59)

This commit is contained in:
StupidScience 2019-10-06 21:50:48 +02:00 committed by Jason O'Donnell
parent d696408fae
commit c6adb89d4b
3 changed files with 21 additions and 0 deletions

View file

@ -30,6 +30,9 @@ spec:
app.kubernetes.io/name: {{ template "vault.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
component: server
{{- if .Values.server.extraLabels -}}
{{- toYaml .Values.server.extraLabels | nindent 8 -}}
{{- end -}}
{{ template "vault.annotations" . }}
spec:
{{ template "vault.affinity" . }}

View file

@ -510,3 +510,16 @@ load _helpers
yq -r '.spec.template.spec.nodeSelector' | tee /dev/stderr)
[ "${actual}" = "testing" ]
}
#--------------------------------------------------------------------
# extra labels
@test "server/standalone-StatefulSet: specify extraLabels" {
cd `chart_dir`
local actual=$(helm template \
-x templates/server-statefulset.yaml \
--set 'server.extraLabels.foo=bar' \
. | tee /dev/stderr |
yq -r '.spec.template.metadata.labels.foo' | tee /dev/stderr)
[ "${actual}" = "bar" ]
}

View file

@ -95,6 +95,11 @@ server:
# beta.kubernetes.io/arch: amd64
nodeSelector: {}
# Extra labels to attach to the server pods
# This should be a multi-line string mapping directly to the a map of
# the labels to apply to the server pods
extraLabels: {}
# Extra annotations to attach to the server pods
# This should be a multi-line string mapping directly to the a map of
# the annotations to apply to the server pods