1- {{- if .Values.collectionSetup .enabled }}
1+ {{- if .Values.load_collections .enabled }}
22---
33apiVersion : batch/v1
44kind : Job
55metadata :
6- name : collection-setup -{{ $.Release.Name }}
6+ name : load-collections -{{ $.Release.Name }}
77 labels :
8- app : collection-setup -{{ $.Release.Name }}
8+ app : load-collections -{{ $.Release.Name }}
99spec :
1010 template :
1111 metadata :
1212 labels :
13- app : collection-setup -{{ $.Release.Name }}
13+ app : load-collections -{{ $.Release.Name }}
1414 spec :
1515 restartPolicy : Never
1616 containers :
17- - name : collectionsetup
18- image : {{ .Values.collectionSetup .image.name }}:{{ .Values.collectionSetup .image.tag }}
19- command : {{- toYaml .Values.collectionSetup .command | nindent 12 }}
17+ - name : load-collections
18+ image : {{ .Values.common .image.name }}:{{ .Values.common .image.tag }}
19+ command : {{- toYaml .Values.load_collections .command | nindent 12 }}
2020 args :
21- {{- toYaml .Values.collectionSetup .args | nindent 12 }}
21+ {{- toYaml .Values.load_collections .args | nindent 12 }}
2222 ports :
2323 - containerPort : 5432
2424 resources :
25- {{- toYaml .Values.collectionSetup.settings .resources | nindent 12 }}
25+ {{- toYaml .Values.common .resources | nindent 12 }}
2626 volumeMounts :
2727 - mountPath : /opt/initdb/sql-data
2828 name : initdb-sql-volume-{{ $.Release.Name }}
3434 - name : PGADMIN_URI
3535 valueFrom :
3636 secretKeyRef :
37- name : {{ .Values.collectionSetup.settings .eoapiReleaseName }}-pguser-postgres
37+ name : {{ .Values.common .eoapiReleaseName }}-pguser-postgres
3838 key : uri
3939 volumes :
4040 - name : initdb-sql-volume-{{ $.Release.Name }}
@@ -46,13 +46,81 @@ spec:
4646 - name : initdb-sh-volume-{{ $.Release.Name }}
4747 configMap :
4848 name : initdb-sh-config-{{ $.Release.Name }}
49- {{- with .Values.collectionSetup.settings .affinity }}
49+ {{- with .Values.common .affinity }}
5050 affinity :
5151 {{- toYaml . | nindent 8 }}
5252 {{- end }}
53- {{- with .Values.collectionSetup.settings .tolerations }}
53+ {{- with .Values.common .tolerations }}
5454 tolerations :
5555 {{- toYaml . | nindent 8 }}
5656 {{- end }}
5757 backoffLimit : 1
58- {{- end }}
58+ {{- end }}
59+ {{- if .Values.update_collection_extents.enabled }}
60+ ---
61+ apiVersion : batch/v1
62+ kind : CronJob
63+ metadata :
64+ name : update-collection-extents-{{ $.Release.Name }}
65+ labels :
66+ app : update-collection-extents-{{ $.Release.Name }}
67+ spec :
68+ # 30 minutes past the hour, every 12 hours
69+ schedule : " 30 */12 * * *"
70+ jobTemplate :
71+ spec :
72+ template :
73+ spec :
74+ containers :
75+ - name : update-collection-extents
76+ image : {{ .Values.common.image.name }}:{{ .Values.common.image.tag }}
77+ imagePullPolicy : IfNotPresent
78+ command : {{- toYaml .Values.update_collection_extents.command | nindent 16 }}
79+ args :
80+ {{- toYaml .Values.update_collection_extents.args | nindent 16 }}
81+ ports :
82+ - containerPort : 5432
83+ resources :
84+ {{- toYaml .Values.common.resources | nindent 16 }}
85+ env :
86+ - name : PGADMIN_URI
87+ valueFrom :
88+ secretKeyRef :
89+ name : {{ .Values.common.eoapiReleaseName }}-pguser-postgres
90+ key : uri
91+ restartPolicy : OnFailure
92+ {{- end }}
93+ {{- if .Values.run_queued_queries.enabled }}
94+ ---
95+ apiVersion : batch/v1
96+ kind : CronJob
97+ metadata :
98+ name : run-queued-queries-{{ $.Release.Name }}
99+ labels :
100+ app : run-queued-queries-{{ $.Release.Name }}
101+ spec :
102+ # every hour
103+ schedule : " 0 * * * *"
104+ jobTemplate :
105+ spec :
106+ template :
107+ spec :
108+ containers :
109+ - name : run-queued-queries
110+ image : {{ .Values.common.image.name }}:{{ .Values.common.image.tag }}
111+ imagePullPolicy : IfNotPresent
112+ command : {{- toYaml .Values.run_queued_queries.command | nindent 16 }}
113+ args :
114+ {{- toYaml .Values.run_queued_queries.args | nindent 16 }}
115+ ports :
116+ - containerPort : 5432
117+ resources :
118+ {{- toYaml .Values.common.resources | nindent 16 }}
119+ env :
120+ - name : PGADMIN_URI
121+ valueFrom :
122+ secretKeyRef :
123+ name : {{ .Values.common.eoapiReleaseName }}-pguser-postgres
124+ key : uri
125+ restartPolicy : OnFailure
126+ {{- end }}
0 commit comments