Add load-moqui initContainer.
Showing
3 changed files
with
50 additions
and
7 deletions
... | @@ -91,9 +91,9 @@ EXPOSE 5701 | ... | @@ -91,9 +91,9 @@ EXPOSE 5701 |
91 | 91 | ||
92 | # this is to run from the war file directly, preferred approach unzips war file in advance | 92 | # this is to run from the war file directly, preferred approach unzips war file in advance |
93 | # ENTRYPOINT ["java", "-jar", "moqui.war"] | 93 | # ENTRYPOINT ["java", "-jar", "moqui.war"] |
94 | ENTRYPOINT ["java", "-cp", ".", "MoquiStart", "port=8080"] | 94 | ENTRYPOINT ["java", "-cp", ".", "MoquiStart"] |
95 | 95 | ||
96 | HEALTHCHECK --interval=30s --timeout=600ms --start-period=120s CMD curl -f -H "X-Forwarded-Proto: https" -H "X-Forwarded-Ssl: on" http://localhost:8080/status || exit 1 | 96 | HEALTHCHECK --interval=30s --timeout=600ms --start-period=120s CMD curl -f -H "X-Forwarded-Proto: https" -H "X-Forwarded-Ssl: on" http://localhost:8080/status || exit 1 |
97 | # specify this as a default parameter if none are specified with docker exec/run, ie run production by default | 97 | # specify this as a default parameter if none are specified with docker exec/run, ie run production by default |
98 | CMD ["conf=conf/MoquiProductionConf.xml"] | 98 | CMD ["port=8080", "conf=conf/MoquiProductionConf.xml"] |
99 | 99 | ... | ... |
... | @@ -15,6 +15,8 @@ data: | ... | @@ -15,6 +15,8 @@ data: |
15 | entity_ds_schema: public | 15 | entity_ds_schema: public |
16 | _entity_add_missing_runtime: "true" | 16 | _entity_add_missing_runtime: "true" |
17 | moqui_load_types: seed,seed-initial,install | 17 | moqui_load_types: seed,seed-initial,install |
18 | moqui.conf: "conf/MoquiProductionConf.xml" | ||
19 | jetty_threads: "100" | ||
18 | --- | 20 | --- |
19 | apiVersion: v1 | 21 | apiVersion: v1 |
20 | kind: Secret | 22 | kind: Secret |
... | @@ -101,6 +103,8 @@ spec: | ... | @@ -101,6 +103,8 @@ spec: |
101 | - name: txlog | 103 | - name: txlog |
102 | persistentVolumeClaim: | 104 | persistentVolumeClaim: |
103 | claimName: moqui-txlog | 105 | claimName: moqui-txlog |
106 | - name: txlog-init | ||
107 | emptyDir: {} | ||
104 | - name: sessions | 108 | - name: sessions |
105 | persistentVolumeClaim: | 109 | persistentVolumeClaim: |
106 | claimName: moqui-sessions | 110 | claimName: moqui-sessions |
... | @@ -122,10 +126,38 @@ spec: | ... | @@ -122,10 +126,38 @@ spec: |
122 | - name: lib | 126 | - name: lib |
123 | mountPath: /mnt/jdbc-drivers | 127 | mountPath: /mnt/jdbc-drivers |
124 | 128 | ||
129 | - name: load-moqui | ||
130 | image: moqui-app:latest | ||
131 | imagePullPolicy: IfNotPresent | ||
132 | args: ["load", "conf=$(moqui.conf)", "types=$(moqui_load_types)"] | ||
133 | resources: | ||
134 | limits: | ||
135 | memory: 1Gi | ||
136 | requests: | ||
137 | memory: 1Gi | ||
138 | envFrom: | ||
139 | - configMapRef: | ||
140 | name: moqui | ||
141 | - secretRef: | ||
142 | name: moqui | ||
143 | env: | ||
144 | - name: entity_add_missing_runtime | ||
145 | value: "true" | ||
146 | volumeMounts: | ||
147 | - name: lib | ||
148 | mountPath: /opt/moqui/runtime/lib | ||
149 | - name: log | ||
150 | mountPath: /opt/moqui/runtime/log | ||
151 | - name: txlog-init | ||
152 | mountPath: /opt/moqui/runtime/txlog | ||
153 | - name: sessions | ||
154 | mountPath: /opt/moqui/runtime/sessions | ||
155 | |||
125 | containers: | 156 | containers: |
126 | - name: moqui | 157 | - name: moqui |
127 | image: moqui-app:latest | 158 | image: moqui-app:latest |
128 | imagePullPolicy: IfNotPresent | 159 | imagePullPolicy: IfNotPresent |
160 | args: ["port=8080", "conf=$(moqui.conf)", "threads=$(jetty_threads)"] | ||
129 | resources: | 161 | resources: |
130 | limits: | 162 | limits: |
131 | memory: 1Gi | 163 | memory: 1Gi |
... | @@ -136,6 +168,9 @@ spec: | ... | @@ -136,6 +168,9 @@ spec: |
136 | name: moqui | 168 | name: moqui |
137 | - secretRef: | 169 | - secretRef: |
138 | name: moqui | 170 | name: moqui |
171 | env: | ||
172 | - name: entity_add_missing_runtime | ||
173 | value: "false" | ||
139 | volumeMounts: | 174 | volumeMounts: |
140 | - name: lib | 175 | - name: lib |
141 | mountPath: /opt/moqui/runtime/lib | 176 | mountPath: /opt/moqui/runtime/lib | ... | ... |
... | @@ -103,7 +103,7 @@ releases: | ... | @@ -103,7 +103,7 @@ releases: |
103 | name: {{ .Values.name }}-moqui-postgresql-scripts | 103 | name: {{ .Values.name }}-moqui-postgresql-scripts |
104 | defaultMode: 0755 | 104 | defaultMode: 0755 |
105 | - op: add | 105 | - op: add |
106 | path: /spec/template/spec/initContainers/- | 106 | path: /spec/template/spec/initContainers/0 |
107 | value: | 107 | value: |
108 | name: wait-for-pg | 108 | name: wait-for-pg |
109 | image: {{ .Values.postgresql.images | get "wait-for-pg.name" }} | 109 | image: {{ .Values.postgresql.images | get "wait-for-pg.name" }} |
... | @@ -137,7 +137,7 @@ releases: | ... | @@ -137,7 +137,7 @@ releases: |
137 | name: {{ .Values.name }}-moqui-elasticsearch-scripts | 137 | name: {{ .Values.name }}-moqui-elasticsearch-scripts |
138 | defaultMode: 0755 | 138 | defaultMode: 0755 |
139 | - op: add | 139 | - op: add |
140 | path: /spec/template/spec/initContainers/- | 140 | path: /spec/template/spec/initContainers/0 |
141 | value: | 141 | value: |
142 | name: wait-for-elasticsearch | 142 | name: wait-for-elasticsearch |
143 | image: {{ .Values.app.images | get "moqui-app.name" }} | 143 | image: {{ .Values.app.images | get "moqui-app.name" }} |
... | @@ -229,12 +229,11 @@ releases: | ... | @@ -229,12 +229,11 @@ releases: |
229 | image: {{ .Values.app.images | get "moqui-jdbc-drivers.name" }} | 229 | image: {{ .Values.app.images | get "moqui-jdbc-drivers.name" }} |
230 | imagePullPolicy: {{ .Values.app.images | get "moqui-jdbc-drivers.pullPolicy" }} | 230 | imagePullPolicy: {{ .Values.app.images | get "moqui-jdbc-drivers.pullPolicy" }} |
231 | 231 | ||
232 | containers: | 232 | - name: load-moqui |
233 | - name: moqui | ||
234 | image: {{ .Values.app.images | get "moqui-app.name" }} | 233 | image: {{ .Values.app.images | get "moqui-app.name" }} |
235 | imagePullPolicy: {{ .Values.app.images | get "moqui-app.pullPolicy" }} | 234 | imagePullPolicy: {{ .Values.app.images | get "moqui-app.pullPolicy" }} |
236 | resources: {{ .Values.app.resources | toYaml | nindent 20 }} | ||
237 | env: | 235 | env: |
236 | {{- block "moquideps" . }} | ||
238 | {{- if .Values.elasticsearch.enabled }} | 237 | {{- if .Values.elasticsearch.enabled }} |
239 | - name: kibana_host | 238 | - name: kibana_host |
240 | value: {{ .Values.name }}-moqui-kb-http | 239 | value: {{ .Values.name }}-moqui-kb-http |
... | @@ -270,5 +269,14 @@ releases: | ... | @@ -270,5 +269,14 @@ releases: |
270 | - name: entity_ds_schema | 269 | - name: entity_ds_schema |
271 | value: public | 270 | value: public |
272 | {{- end }} | 271 | {{- end }} |
272 | {{- end }} | ||
273 | |||
274 | containers: | ||
275 | - name: moqui | ||
276 | image: {{ .Values.app.images | get "moqui-app.name" }} | ||
277 | imagePullPolicy: {{ .Values.app.images | get "moqui-app.pullPolicy" }} | ||
278 | resources: {{ .Values.app.resources | toYaml | nindent 20 }} | ||
279 | env: | ||
280 | {{- template "moquideps" . }} | ||
273 | 281 | ||
274 | 282 | ... | ... |
-
Please register or sign in to post a comment