Support to add annotations in injector serviceaccount (#753)
This commit is contained in:
parent
44a07b8970
commit
6c14d9d656
5 changed files with 42 additions and 0 deletions
|
@ -470,6 +470,21 @@ Sets extra injector service annotations
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Sets extra injector service account annotations
|
||||||
|
*/}}
|
||||||
|
{{- define "injector.serviceAccount.annotations" -}}
|
||||||
|
{{- if and (ne .mode "dev") .Values.injector.serviceAccount.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- $tp := typeOf .Values.injector.serviceAccount.annotations }}
|
||||||
|
{{- if eq $tp "string" }}
|
||||||
|
{{- tpl .Values.injector.serviceAccount.annotations . | nindent 4 }}
|
||||||
|
{{- else }}
|
||||||
|
{{- toYaml .Values.injector.serviceAccount.annotations | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Sets extra injector webhook annotations
|
Sets extra injector webhook annotations
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
@ -9,4 +9,5 @@ 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.serviceAccount.annotations" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -20,3 +20,13 @@ load _helpers
|
||||||
yq 'length > 0' | tee /dev/stderr)
|
yq 'length > 0' | tee /dev/stderr)
|
||||||
[ "${actual}" = "false" ]
|
[ "${actual}" = "false" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "injector/ServiceAccount: generic annotations" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/injector-serviceaccount.yaml \
|
||||||
|
--set 'injector.serviceAccount.annotations=vaultIsAwesome: true' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.metadata.annotations["vaultIsAwesome"]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "true" ]
|
||||||
|
}
|
||||||
|
|
|
@ -373,6 +373,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"serviceAccount": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"annotations": {
|
||||||
|
"type": [
|
||||||
|
"object",
|
||||||
|
"string"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"strategy": {
|
"strategy": {
|
||||||
"type": [
|
"type": [
|
||||||
"object",
|
"object",
|
||||||
|
|
|
@ -269,6 +269,11 @@ injector:
|
||||||
# Extra annotations to attach to the injector service
|
# Extra annotations to attach to the injector service
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|
||||||
|
# Injector serviceAccount specific config
|
||||||
|
serviceAccount:
|
||||||
|
# Extra annotations to attach to the injector serviceAccount
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
# A disruption budget limits the number of pods of a replicated application
|
# A disruption budget limits the number of pods of a replicated application
|
||||||
# that are down simultaneously from voluntary disruptions
|
# that are down simultaneously from voluntary disruptions
|
||||||
podDisruptionBudget: {}
|
podDisruptionBudget: {}
|
||||||
|
|
Loading…
Reference in a new issue