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