Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 3 | # Modifications Copyright © 2018 AT&T, ZTE |
Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 4 | # |
| 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 | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 16 | */}} |
Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 17 | |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 18 | apiVersion: apps/v1 |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 19 | kind: Deployment |
| 20 | metadata: |
| 21 | name: {{ include "common.fullname" . }} |
| 22 | namespace: {{ include "common.namespace" . }} |
| 23 | labels: |
| 24 | app: {{ include "common.name" . }} |
| 25 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 26 | release: {{ include "common.release" . }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 27 | heritage: {{ .Release.Service }} |
| 28 | spec: |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 32 | replicas: {{ .Values.replicaCount }} |
| 33 | template: |
| 34 | metadata: |
| 35 | labels: |
| 36 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 37 | release: {{ include "common.release" . }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 38 | spec: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 39 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 40 | - name: {{ include "common.name" . }}-job-completion |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 41 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 42 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 43 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 44 | - /app/ready.py |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 45 | args: |
| 46 | - --job-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 47 | - {{ include "common.release" . }}-sdc-be-config-backend |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 48 | - "-t" |
| 49 | - "35" |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 50 | env: |
| 51 | - name: NAMESPACE |
| 52 | valueFrom: |
| 53 | fieldRef: |
| 54 | apiVersion: v1 |
| 55 | fieldPath: metadata.namespace |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 56 | resources: |
| 57 | limits: |
| 58 | cpu: 100m |
| 59 | memory: 100Mi |
| 60 | requests: |
| 61 | cpu: 3m |
| 62 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 63 | {{- if .Values.global.aafEnabled }} |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 64 | - name: {{ include "common.name" . }}-update-config |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 65 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 67 | command: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 68 | - sh |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 69 | args: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 70 | - "-c" |
| 71 | - | |
| 72 | export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
| 73 | export KEYSTORE_PASS=$cadi_keystore_password_p12 |
| 74 | export KEYMANAGER_PASS=$cadi_keystore_password_p12 |
| 75 | export TRUSTSTORE_PASS=$cadi_truststore_password |
| 76 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /config-output |
| 77 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /config-output |
| 78 | cd /config-input && \ |
| 79 | for PFILE in `find . -not -type d | grep -v -F ..` |
| 80 | do |
| 81 | envsubst <${PFILE} >/config-output/${PFILE} |
| 82 | chmod 0755 /config-output/${PFILE} |
| 83 | done |
| 84 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 85 | - name: sdc-environments-input |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 86 | mountPath: /config-input/ |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 87 | - name: sdc-environments |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 88 | mountPath: /config-output/ |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 89 | resources: |
| 90 | limits: |
| 91 | cpu: 100m |
| 92 | memory: 100Mi |
| 93 | requests: |
| 94 | cpu: 3m |
| 95 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 96 | {{- end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 97 | containers: |
| 98 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 99 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 100 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 101 | {{- if .Values.global.aafEnabled }} |
| 102 | command: |
| 103 | - sh |
| 104 | args: |
| 105 | - "-c" |
| 106 | - | |
| 107 | sed -i '/trustStorePassword/d' ${JETTY_BASE}/startup.sh |
| 108 | ${JETTY_BASE}/startup.sh |
| 109 | {{- end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 110 | ports: |
| 111 | - containerPort: {{ .Values.service.internalPort }} |
| 112 | - containerPort: {{ .Values.service.internalPort2 }} |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 113 | {{ if eq .Values.liveness.enabled true }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 114 | livenessProbe: |
| 115 | tcpSocket: |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 116 | port: {{ .Values.service.internalPort2 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 117 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 118 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Brian Freeman | 6142d94 | 2019-10-02 09:50:19 -0500 | [diff] [blame] | 119 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 120 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 121 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 122 | {{ end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 123 | readinessProbe: |
| 124 | tcpSocket: |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 125 | port: {{ .Values.service.internalPort2 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 126 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 127 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 128 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
| 129 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 130 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
| 131 | startupProbe: |
| 132 | tcpSocket: |
| 133 | port: {{ .Values.service.internalPort2 }} |
| 134 | initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }} |
| 135 | periodSeconds: {{ .Values.startup.periodSeconds }} |
| 136 | timeoutSeconds: {{ .Values.startup.timeoutSeconds }} |
| 137 | successThreshold: {{ .Values.startup.successThreshold }} |
| 138 | failureThreshold: {{ .Values.startup.failureThreshold }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 139 | resources: {{ include "common.resources" . | nindent 12 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 140 | env: |
| 141 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 142 | value: {{ .Values.env.name }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 143 | - name: HOST_IP |
| 144 | valueFrom: |
| 145 | fieldRef: |
| 146 | fieldPath: status.podIP |
| 147 | - name: JAVA_OPTIONS |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 148 | value: {{ .Values.config.javaOptions }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 149 | volumeMounts: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 150 | - name: sdc-environments |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 151 | mountPath: /app/jetty/chef-solo/environments/ |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 152 | {{- if .Values.global.aafEnabled }} |
| 153 | - name: sdc-environments |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 154 | mountPath: /app/jetty/chef-solo/cookbooks/sdc-catalog-fe/files/default/org.onap.sdc.p12 |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 155 | subPath: org.onap.sdc.p12 |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 156 | - name: sdc-environments |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 157 | mountPath: /app/jetty/chef-solo/cookbooks/sdc-catalog-fe/files/default/org.onap.sdc.trust.jks |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 158 | subPath: org.onap.sdc.trust.jks |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 159 | {{- end }} |
| 160 | - name: localtime |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 161 | mountPath: /etc/localtime |
| 162 | readOnly: true |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 163 | - name: logs |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 164 | mountPath: /var/log/onap |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 165 | - name: configs |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 166 | mountPath: /app/jetty/config/catalog-fe/plugins-configuration.yaml |
shrikantawachar | 0c84bc3 | 2019-01-16 13:12:21 +0530 | [diff] [blame] | 167 | subPath: plugins-configuration.yaml |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 168 | - name: logback |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 169 | mountPath: /tmp/logback.xml |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 170 | subPath: logback.xml |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 171 | lifecycle: |
| 172 | postStart: |
| 173 | exec: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 174 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/app/jetty/config/catalog-fe/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"] |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 175 | # side car containers |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 176 | {{ include "common.log.sidecar" . | nindent 8 }} |
farida azmy | 1383b4c | 2021-04-06 12:33:31 +0200 | [diff] [blame] | 177 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 178 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 179 | - name: localtime |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 180 | hostPath: |
| 181 | path: /etc/localtime |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 182 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 183 | - name: configs |
shrikantawachar | 0c84bc3 | 2019-01-16 13:12:21 +0530 | [diff] [blame] | 184 | configMap: |
| 185 | name : {{ include "common.fullname" . }}-plugins-configmap |
| 186 | defaultMode: 0777 |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 187 | - name: logback |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 188 | configMap: |
| 189 | name : {{ include "common.fullname" . }}-logging-configmap |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 190 | - name: sdc-environments |
| 191 | {{- if .Values.global.aafEnabled }} |
| 192 | emptyDir: { medium: "Memory" } |
| 193 | - name: sdc-environments-input |
| 194 | {{- end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 195 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 196 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 197 | defaultMode: 0755 |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 198 | - name: logs |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 199 | emptyDir: {} |
| 200 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 201 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |