Skip to content

Commit 1569536

Browse files
author
Shengwen YU
authored
Merge pull request #1423 from kimxogus/feat/init-containers
feat: add init containers
2 parents f547605 + e5c177c commit 1569536

File tree

9 files changed

+83
-0
lines changed

9 files changed

+83
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Large diffs are not rendered by default.

templates/core/core-dpl.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ spec:
5757
component: core
5858
{{- end }}
5959
{{- end }}
60+
{{- with .Values.core.initContainers }}
61+
initContainers:
62+
{{- toYaml . | nindent 8 }}
63+
{{- end }}
6064
containers:
6165
- name: core
6266
image: {{ .Values.core.image.repository }}:{{ .Values.core.image.tag }}

templates/database/database-ss.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ spec:
6363
- name: database-data
6464
mountPath: /var/lib/postgresql/data
6565
subPath: {{ $database.subPath }}
66+
{{- with .Values.database.internal.extrInitContainers }}
67+
{{- toYaml . | nindent 6 }}
68+
{{- end }}
6669
containers:
6770
- name: database
6871
image: {{ .Values.database.internal.image.repository }}:{{ .Values.database.internal.image.tag }}

templates/jobservice/jobservice-dpl.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ spec:
6363
component: jobservice
6464
{{- end }}
6565
{{- end }}
66+
{{- with .Values.jobservice.initContainers }}
67+
initContainers:
68+
{{- toYaml . | nindent 8 }}
69+
{{- end }}
6670
containers:
6771
- name: jobservice
6872
image: {{ .Values.jobservice.image.repository }}:{{ .Values.jobservice.image.tag }}

templates/portal/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ spec:
5454
component: portal
5555
{{- end }}
5656
{{- end }}
57+
{{- with .Values.portal.initContainers }}
58+
initContainers:
59+
{{- toYaml . | nindent 8 }}
60+
{{- end }}
5761
containers:
5862
- name: portal
5963
image: {{ .Values.portal.image.repository }}:{{ .Values.portal.image.tag }}

templates/redis/statefulset.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ spec:
4141
{{- end }}
4242
automountServiceAccountToken: {{ .Values.redis.internal.automountServiceAccountToken | default false }}
4343
terminationGracePeriodSeconds: 120
44+
{{- with .Values.redis.internal.initContainers }}
45+
initContainers:
46+
{{- toYaml . | nindent 8 }}
47+
{{- end }}
4448
containers:
4549
- name: redis
4650
image: {{ .Values.redis.internal.image.repository }}:{{ .Values.redis.internal.image.tag }}

templates/registry/registry-dpl.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ spec:
6666
component: registry
6767
{{- end }}
6868
{{- end }}
69+
{{- with .Values.registry.initContainers }}
70+
initContainers:
71+
{{- toYaml . | nindent 8 }}
72+
{{- end }}
6973
containers:
7074
- name: registry
7175
image: {{ .Values.registry.registry.image.repository }}:{{ .Values.registry.registry.image.tag }}

templates/trivy/trivy-sts.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ spec:
5656
component: trivy
5757
{{- end }}
5858
{{- end }}
59+
{{- with .Values.trivy.initContainers }}
60+
initContainers:
61+
{{- toYaml . | nindent 8 }}
62+
{{- end }}
5963
containers:
6064
- name: trivy
6165
image: {{ .Values.trivy.image.repository }}:{{ .Values.trivy.image.tag }}

values.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,13 @@ portal:
543543
serviceAnnotations: {}
544544
## The priority class to run the pod as
545545
priorityClassName:
546+
# containers to be run before the controller's container starts.
547+
initContainers: []
548+
# Example:
549+
#
550+
# - name: wait
551+
# image: busybox
552+
# command: [ 'sh', '-c', "sleep 20" ]
546553

547554
core:
548555
image:
@@ -580,6 +587,13 @@ core:
580587
serviceAnnotations: {}
581588
## The priority class to run the pod as
582589
priorityClassName:
590+
# containers to be run before the controller's container starts.
591+
initContainers: []
592+
# Example:
593+
#
594+
# - name: wait
595+
# image: busybox
596+
# command: [ 'sh', '-c', "sleep 20" ]
583597
## User settings configuration json string
584598
configureUserSettings:
585599
# The provider for updating project quota(usage), there are 2 options, redis or db.
@@ -654,6 +668,13 @@ jobservice:
654668
podLabels: {}
655669
## The priority class to run the pod as
656670
priorityClassName:
671+
# containers to be run before the controller's container starts.
672+
initContainers: []
673+
# Example:
674+
#
675+
# - name: wait
676+
# image: busybox
677+
# command: [ 'sh', '-c', "sleep 20" ]
657678
maxJobWorkers: 10
658679
# The logger for jobs: "file", "database" or "stdout"
659680
jobLoggers:
@@ -719,6 +740,13 @@ registry:
719740
podLabels: {}
720741
## The priority class to run the pod as
721742
priorityClassName:
743+
# containers to be run before the controller's container starts.
744+
initContainers: []
745+
# Example:
746+
#
747+
# - name: wait
748+
# image: busybox
749+
# command: [ 'sh', '-c', "sleep 20" ]
722750
# Secret is used to secure the upload state from client
723751
# and registry storage backend.
724752
# See: https://github.com/distribution/distribution/blob/main/docs/configuration.md#http
@@ -796,6 +824,13 @@ trivy:
796824
podLabels: {}
797825
## The priority class to run the pod as
798826
priorityClassName:
827+
# containers to be run before the controller's container starts.
828+
initContainers: []
829+
# Example:
830+
#
831+
# - name: wait
832+
# image: busybox
833+
# command: [ 'sh', '-c', "sleep 20" ]
799834
# debugMode the flag to enable Trivy debug mode with more verbose scanning log
800835
debugMode: false
801836
# vulnType a comma-separated list of vulnerability types. Possible values are `os` and `library`.
@@ -873,6 +908,13 @@ database:
873908
affinity: {}
874909
## The priority class to run the pod as
875910
priorityClassName:
911+
# containers to be run before the controller's container starts.
912+
extrInitContainers: []
913+
# Example:
914+
#
915+
# - name: wait
916+
# image: busybox
917+
# command: [ 'sh', '-c', "sleep 20" ]
876918
# The initial superuser password for internal database
877919
password: "changeit"
878920
# The size limit for Shared memory, pgSQL use it for shared_buffer
@@ -940,6 +982,13 @@ redis:
940982
affinity: {}
941983
## The priority class to run the pod as
942984
priorityClassName:
985+
# containers to be run before the controller's container starts.
986+
initContainers: []
987+
# Example:
988+
#
989+
# - name: wait
990+
# image: busybox
991+
# command: [ 'sh', '-c', "sleep 20" ]
943992
# # jobserviceDatabaseIndex defaults to "1"
944993
# # registryDatabaseIndex defaults to "2"
945994
# # trivyAdapterIndex defaults to "5"

0 commit comments

Comments
 (0)