feat: add annotations to injector service (#425)
This commit is contained in:
parent
0101816d8d
commit
73e90a1308
4 changed files with 31 additions and 0 deletions
|
@ -293,6 +293,21 @@ Sets extra injector pod annotations
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Sets extra injector service annotations
|
||||||
|
*/}}
|
||||||
|
{{- define "injector.service.annotations" -}}
|
||||||
|
{{- if .Values.injector.service.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- $tp := typeOf .Values.injector.service.annotations }}
|
||||||
|
{{- if eq $tp "string" }}
|
||||||
|
{{- tpl .Values.injector.service.annotations . | nindent 4 }}
|
||||||
|
{{- else }}
|
||||||
|
{{- toYaml .Values.injector.service.annotations | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Sets extra ui service annotations
|
Sets extra ui service annotations
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
@ -8,6 +8,7 @@ metadata:
|
||||||
app.kubernetes.io/name: {{ include "vault.name" . }}-agent-injector
|
app.kubernetes.io/name: {{ include "vault.name" . }}-agent-injector
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{ template "injector.service.annotations" . }}
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- port: 443
|
- port: 443
|
||||||
|
|
|
@ -35,3 +35,13 @@ load _helpers
|
||||||
yq 'length > 0' | tee /dev/stderr)
|
yq 'length > 0' | tee /dev/stderr)
|
||||||
[ "${actual}" = "false" ]
|
[ "${actual}" = "false" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "injector/Service: generic annotations" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/injector-service.yaml \
|
||||||
|
--set 'injector.service.annotations=vaultIsAwesome: true' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.metadata.annotations["vaultIsAwesome"]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "true" ]
|
||||||
|
}
|
||||||
|
|
|
@ -134,6 +134,11 @@ injector:
|
||||||
# of the annotations to apply to the injector pods
|
# of the annotations to apply to the injector pods
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|
||||||
|
# Injector service specific config
|
||||||
|
service:
|
||||||
|
# Extra annotations to attach to the injector service
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
server:
|
server:
|
||||||
# Resource requests, limits, etc. for the server cluster placement. This
|
# Resource requests, limits, etc. for the server cluster placement. This
|
||||||
# should map directly to the value of the resources field for a PodSpec.
|
# should map directly to the value of the resources field for a PodSpec.
|
||||||
|
|
Loading…
Reference in a new issue