Skip to content

Commit

Permalink
Missing pod annotation and security constraint in helm chart (#356)
Browse files Browse the repository at this point in the history
Add option to add pod annotation and pod security constraint
in helm charts

Change-Id: I1fc7d7d2ca60411439669921fb6a353bb001225a

Co-authored-by: Olivier Germain <[email protected]>
  • Loading branch information
germaino and Olivier Germain authored Mar 1, 2023
1 parent dca0cf1 commit 887c452
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chart/docker-auth/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "1.8.0"
description: Docker Registry V2 authentication server
name: docker-auth
version: 1.3.0
version: 1.4.0
keywords:
- docker
- registry
Expand Down
17 changes: 17 additions & 0 deletions chart/docker-auth/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,27 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.podAnnotations }}
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.podSecurityContext }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
{{- if .Values.containerSecurityContext }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
args: ["--v={{ .Values.logging.level }}", "-logtostderr", "/config/auth_config.yml"]
volumeMounts:
- name: {{ include "docker-auth.name" . }}-config
Expand Down
10 changes: 10 additions & 0 deletions chart/docker-auth/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,13 @@ nodeSelector: {}
tolerations: []

affinity: {}

# podAnnotations to use for the deployment. Optional
podAnnotations: {}

# SecurityContext at container level to use for the deployment. Optional
containerSecurityContext: {}

# SecurityContext at pod level to use for the deployment. Optional
podSecurityContext: {}

0 comments on commit 887c452

Please sign in to comment.