Added option to run init as a job instead of initContainers

This commit is contained in:
2023-09-23 12:49:56 +00:00
parent 041946b804
commit cbb973550c
6 changed files with 157 additions and 6 deletions

View File

@@ -12,12 +12,10 @@ spec:
replicas: 1
{{- end }}
selector:
matchLabels:
{{- include "..selector-labels" . | nindent 6 }}
matchLabels: {{- include "..selector-labels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "..selector-labels" . | nindent 8 }}
labels: {{- include "..selector-labels" . | nindent 8 }}
spec:
securityContext:
fsGroup: 101
@@ -73,6 +71,7 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if not .Values.init.asJob }}
initContainers:
{{- if and .Values.storage.cloud.active .Values.storage.local.active .Values.storage.local.cloneCloud }}
- name: init-local-storage
@@ -82,7 +81,7 @@ spec:
image: cloudyne/ubuntu-ci:latest
command: ["python3"]
args: ["/usr/local/bin/storage-clone", "/mnt/cloud", "/mnt/local"]
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
volumeMounts:
- name: cloud
mountPath: /mnt/cloud
@@ -118,6 +117,7 @@ spec:
{{- end }}
{{- end }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "..fullname" . }}-env
@@ -133,6 +133,7 @@ spec:
name: {{ include "..fullname" . }}-db-auth
command: ["sh"]
args: ["-c", "/init-go/init-go"]
{{- end }}
containers:
- name: wordpress
securityContext: