mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-07 08:35:40 +02:00
Adds pullSecret option and simplifies image usage (#1765)
Adds a value field to set a Secret to pull the image from an image registry with authentication, in case you need to host the image yourself and your registry has authentication. To simplify the configuration we set the initContainers to use the same image as the application itself. This has the following advantages: - No additional configuration for image and pull Secret in values needed - The used image is always up-to-date now. No need to maintain an extra alpine image. - Faster startup times. No extra images have to be pulled. Signed-off-by: pmarkiewka <philipp.markiewka@cloudogu.com>
This commit is contained in:
@@ -45,19 +45,27 @@ spec:
|
||||
app: {{ include "scm-manager.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
{{- if .Values.image.pullSecret }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Values.image.pullSecret }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
- name: volume-permissions
|
||||
image: alpine:3.8
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ['sh', '-c', 'chown 1000:1000 /data']
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
{{- if .Values.plugins }}
|
||||
- name: install-plugins
|
||||
image: alpine:3.8
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ['sh', '/scripts/install-plugins.sh']
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
@@ -113,11 +121,11 @@ spec:
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
- name: config
|
||||
configMap:
|
||||
configMap:
|
||||
name: {{ include "scm-manager.fullname" . }}
|
||||
{{- if .Values.plugins }}
|
||||
- name: scripts
|
||||
configMap:
|
||||
configMap:
|
||||
name: {{ include "scm-manager.fullname" . }}-scripts
|
||||
{{- end }}
|
||||
{{- with .Values.extraVolumes }}
|
||||
|
||||
@@ -33,6 +33,8 @@ image:
|
||||
tag: ${dockerTag}
|
||||
# image.pullPolicy -- SCM-Manager image pull policy
|
||||
pullPolicy: IfNotPresent
|
||||
# image.pullSecret -- Secret with credentials for the image registry
|
||||
# pullSecret: registry-credentials
|
||||
|
||||
# nameOverride -- Override the resource name prefix
|
||||
nameOverride: ""
|
||||
|
||||
Reference in New Issue
Block a user