Skip to content

Commit 887c452

Browse files
germainoOlivier Germain
and
Olivier Germain
authored
Missing pod annotation and security constraint in helm chart (#356)
Add option to add pod annotation and pod security constraint in helm charts Change-Id: I1fc7d7d2ca60411439669921fb6a353bb001225a Co-authored-by: Olivier Germain <[email protected]>
1 parent dca0cf1 commit 887c452

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

chart/docker-auth/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: "1.8.0"
33
description: Docker Registry V2 authentication server
44
name: docker-auth
5-
version: 1.3.0
5+
version: 1.4.0
66
keywords:
77
- docker
88
- registry

chart/docker-auth/templates/deployment.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,27 @@ spec:
2020
app.kubernetes.io/instance: {{ .Release.Name }}
2121
annotations:
2222
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
23+
{{- if .Values.podAnnotations }}
24+
{{- range $key, $value := .Values.podAnnotations }}
25+
{{ $key }}: {{ $value | quote }}
26+
{{- end }}
27+
{{- end }}
2328
spec:
29+
{{- if .Values.podSecurityContext }}
30+
{{- with .Values.podSecurityContext }}
31+
securityContext:
32+
{{- toYaml . | nindent 8 }}
33+
{{- end }}
34+
{{- end }}
2435
containers:
2536
- name: {{ .Chart.Name }}
2637
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
38+
{{- if .Values.containerSecurityContext }}
39+
{{- with .Values.containerSecurityContext }}
40+
securityContext:
41+
{{- toYaml . | nindent 12 }}
42+
{{- end }}
43+
{{- end }}
2744
args: ["--v={{ .Values.logging.level }}", "-logtostderr", "/config/auth_config.yml"]
2845
volumeMounts:
2946
- name: {{ include "docker-auth.name" . }}-config

chart/docker-auth/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,13 @@ nodeSelector: {}
7878
tolerations: []
7979

8080
affinity: {}
81+
82+
# podAnnotations to use for the deployment. Optional
83+
podAnnotations: {}
84+
85+
# SecurityContext at container level to use for the deployment. Optional
86+
containerSecurityContext: {}
87+
88+
# SecurityContext at pod level to use for the deployment. Optional
89+
podSecurityContext: {}
90+

0 commit comments

Comments
 (0)