Jakub Latusek | a0b0d97 | 2020-10-21 13:36:30 +0200 | [diff] [blame] | 1 | {{/* |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 2 | # Copyright © 2018 ZTE |
| 3 | # Modifications Copyright © 2018 AT&T, Amdocs, Bell Canada |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 4 | # Modifications Copyright © 2022 CMCC Corporation |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Jakub Latusek | a0b0d97 | 2020-10-21 13:36:30 +0200 | [diff] [blame] | 16 | */}} |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 17 | |
Grzegorz-Lis | b571703 | 2020-07-28 09:57:43 +0200 | [diff] [blame] | 18 | apiVersion: apps/v1 |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 19 | kind: Deployment |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 20 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 21 | spec: |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 23 | replicas: {{ .Values.replicaCount }} |
| 24 | template: |
Andreas Geissler | 22f3b16 | 2023-02-07 13:10:01 +0100 | [diff] [blame] | 25 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 26 | spec: |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 27 | {{ include "common.podSecurityContext" . | indent 6 | trim }} |
| 28 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . ) }} |
Sylvain Desbureaux | e6a1a37 | 2021-02-25 18:07:55 +0100 | [diff] [blame] | 29 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 30 | - command: |
| 31 | - sh |
| 32 | args: |
| 33 | - -c |
| 34 | - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 35 | env: |
| 36 | - name: KEYSTORE_PASSWORD |
| 37 | value: "${KEYSTORE_PASSWORD}" |
| 38 | - name: POSTGRES_USERNAME |
| 39 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }} |
| 40 | - name: POSTGRES_PASSWORD |
| 41 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }} |
| 42 | volumeMounts: |
| 43 | - mountPath: /config-input |
| 44 | name: init-data-input |
| 45 | - mountPath: /config |
| 46 | name: init-data |
| 47 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
| 48 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 49 | name: {{ include "common.name" . }}-update-config |
| 50 | |
| 51 | - command: |
| 52 | - /app/ready.py |
| 53 | args: |
| 54 | - --container-name |
| 55 | - "{{ .Values.postgres.nameOverride }}" |
| 56 | env: |
| 57 | - name: NAMESPACE |
| 58 | valueFrom: |
| 59 | fieldRef: |
| 60 | apiVersion: v1 |
| 61 | fieldPath: metadata.namespace |
| 62 | image: {{ include "repositoryGenerator.image.readiness" . }} |
| 63 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 64 | name: {{ include "common.name" . }}-readiness |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 65 | containers: |
| 66 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 666bedf | 2020-11-19 17:38:23 +0100 | [diff] [blame] | 67 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 68 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | e6a1a37 | 2021-02-25 18:07:55 +0100 | [diff] [blame] | 69 | command: |
| 70 | - sh |
| 71 | args: |
| 72 | - -c |
| 73 | - | |
| 74 | export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
| 75 | bash /uui/run.sh |
Andreas Geissler | 22f3b16 | 2023-02-07 13:10:01 +0100 | [diff] [blame] | 76 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 77 | # disable liveness probe when breakpoints set in debugger |
| 78 | # so K8s doesn't restart unresponsive container |
| 79 | {{- if eq .Values.liveness.enabled true }} |
| 80 | livenessProbe: |
| 81 | tcpSocket: |
| 82 | port: {{ .Values.service.internalPort }} |
| 83 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 84 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 85 | {{- end }} |
Sylvain Desbureaux | e6a1a37 | 2021-02-25 18:07:55 +0100 | [diff] [blame] | 86 | resources: {{ include "common.resources" . | nindent 12 }} |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 87 | readinessProbe: |
| 88 | tcpSocket: |
| 89 | port: {{ .Values.service.internalPort }} |
| 90 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 91 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 92 | env: |
| 93 | - name: MSB_ADDR |
| 94 | value: {{tpl .Values.msbaddr .}} |
| 95 | - name: MR_ADDR |
| 96 | value: {{tpl .Values.mraddr .}} |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 97 | - name: POSTGRES_IP |
| 98 | value: {{.Values.postgres.service.name2}} |
| 99 | - name: POSTGRES_PORT |
| 100 | value: "$(UUI_SERVER_POSTGRES_SERVICE_PORT)" |
Sylvain Desbureaux | e6a1a37 | 2021-02-25 18:07:55 +0100 | [diff] [blame] | 101 | - name: SPRING_OPTS |
| 102 | value: --spring.config.location=file:/config/application.properties |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 103 | - name: POSTGRES_DB_NAME |
| 104 | value: {{ .Values.postgres.config.pgDatabase }} |
Sylvain Desbureaux | e6a1a37 | 2021-02-25 18:07:55 +0100 | [diff] [blame] | 105 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
| 106 | - mountPath: /uui/run.sh |
| 107 | name: entrypoint |
| 108 | subPath: run.sh |
| 109 | - mountPath: /config/application.properties |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 110 | name: init-data |
Sylvain Desbureaux | e6a1a37 | 2021-02-25 18:07:55 +0100 | [diff] [blame] | 111 | subPath: application.properties |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 112 | volumes: |
| 113 | - name: init-data-input |
Sylvain Desbureaux | e6a1a37 | 2021-02-25 18:07:55 +0100 | [diff] [blame] | 114 | configMap: |
| 115 | name: {{ include "common.fullname" . }} |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 116 | - name: init-data |
| 117 | emptyDir: |
| 118 | medium: Memory |
Sylvain Desbureaux | e6a1a37 | 2021-02-25 18:07:55 +0100 | [diff] [blame] | 119 | - name: entrypoint |
| 120 | configMap: |
| 121 | name: {{ include "common.fullname" . }}-entrypoint |
| 122 | defaultMode: 0755 |
JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 123 | {{ include "common.certInitializer.volumes" . | nindent 6 }} |
vaibhav_16dec | 14d5161 | 2018-03-28 07:48:35 +0000 | [diff] [blame] | 124 | imagePullSecrets: |
| 125 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |