Skip to content

Commit

Permalink
feat(helm): add a service account for the registry
Browse files Browse the repository at this point in the history
The annotations of the service account are configurable through helm values.
  • Loading branch information
plaffitt authored and Nicolasgouze committed Nov 22, 2023
1 parent b62459e commit 3ea99e5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions helm/kube-image-keeper/templates/registry-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
{{- if .Values.registry.priorityClassName }}
priorityClassName: {{ .Values.registry.priorityClassName | quote }}
{{- end }}
serviceAccountName: {{ include "kube-image-keeper.fullname" . }}-registry
securityContext:
{{- toYaml .Values.registry.podSecurityContext | nindent 8 }}
containers:
Expand Down
10 changes: 10 additions & 0 deletions helm/kube-image-keeper/templates/registry-serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "kube-image-keeper.fullname" . }}-registry
labels:
{{- include "kube-image-keeper.labels" . | nindent 4 }}
{{- with .Values.registry.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
1 change: 1 addition & 0 deletions helm/kube-image-keeper/templates/registry-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
{{- if .Values.registry.priorityClassName }}
priorityClassName: {{ .Values.registry.priorityClassName | quote }}
{{- end }}
serviceAccountName: {{ include "kube-image-keeper.fullname" . }}-registry
securityContext:
{{- toYaml .Values.registry.podSecurityContext | nindent 8 }}
{{- if .Values.registry.persistence.enabled }}
Expand Down
3 changes: 3 additions & 0 deletions helm/kube-image-keeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ registry:
extraLabels: {}
# -- Relabel config for the ServiceMonitor, see: https://coreos.com/operators/prometheus/docs/latest/api.html#relabelconfig
relabelings: []
serviceAccount:
# -- Annotations to add to the servicateAccount
annotations: {}

registryUI:
# -- If true, enable the registry user interface
Expand Down

0 comments on commit 3ea99e5

Please sign in to comment.