Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +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 |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 4 | # Modifications Copyright © 2021 Orange |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 17 | */}} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 18 | |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 19 | apiVersion: apps/v1 |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 20 | kind: Deployment |
| 21 | metadata: |
| 22 | name: {{ include "common.fullname" . }} |
| 23 | namespace: {{ include "common.namespace" . }} |
| 24 | labels: |
| 25 | app: {{ include "common.name" . }} |
| 26 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 27 | release: {{ include "common.release" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 28 | heritage: {{ .Release.Service }} |
| 29 | spec: |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 30 | selector: |
| 31 | matchLabels: |
| 32 | app: {{ include "common.name" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 33 | replicas: {{ .Values.replicaCount }} |
| 34 | template: |
| 35 | metadata: |
| 36 | labels: |
| 37 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 38 | release: {{ include "common.release" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 39 | spec: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 40 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 41 | - name: {{ include "common.name" . }}-job-completion |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 42 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 43 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 44 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 45 | - /app/ready.py |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 46 | args: |
| 47 | - --job-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 48 | - {{ include "common.release" . }}-sdc-onboarding-be-cassandra-init |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 49 | env: |
| 50 | - name: NAMESPACE |
| 51 | valueFrom: |
| 52 | fieldRef: |
| 53 | apiVersion: v1 |
| 54 | fieldPath: metadata.namespace |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 55 | resources: |
| 56 | limits: |
| 57 | cpu: 100m |
| 58 | memory: 100Mi |
| 59 | requests: |
| 60 | cpu: 3m |
| 61 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 62 | {{- if .Values.global.aafEnabled }} |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 63 | - name: {{ include "common.name" . }}-update-config |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 64 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 65 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 66 | command: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 67 | - sh |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 68 | args: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 69 | - "-c" |
| 70 | - | |
| 71 | export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
| 72 | export KEYSTORE_PASS=$cadi_keystore_password_p12 |
| 73 | export KEYMANAGER_PASS=$cadi_keystore_password_p12 |
| 74 | export TRUSTSTORE_PASS=$cadi_truststore_password |
| 75 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /config-output |
| 76 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /config-output |
| 77 | cd /config-input && \ |
| 78 | for PFILE in `find . -not -type d | grep -v -F ..` |
| 79 | do |
| 80 | envsubst <${PFILE} >/config-output/${PFILE} |
| 81 | chmod 0755 /config-output/${PFILE} |
| 82 | done |
| 83 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 84 | - name: sdc-environments-input |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 85 | mountPath: /config-input/ |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 86 | - name: sdc-environments |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 87 | mountPath: /config-output/ |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 88 | resources: |
| 89 | limits: |
| 90 | cpu: 100m |
| 91 | memory: 100Mi |
| 92 | requests: |
| 93 | cpu: 3m |
| 94 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 95 | {{- end }} |
Krzysztof Kuzmicki | 868a280 | 2020-11-20 17:00:27 +0100 | [diff] [blame] | 96 | - name: volume-permissions |
Sylvain Desbureaux | 80f32ff | 2021-05-03 15:24:59 +0200 | [diff] [blame] | 97 | image: {{ include "repositoryGenerator.image.busybox" . }} |
Krzysztof Kuzmicki | 868a280 | 2020-11-20 17:00:27 +0100 | [diff] [blame] | 98 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 99 | command: |
| 100 | - sh |
| 101 | args: |
| 102 | - "-c" |
| 103 | - | |
| 104 | chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} //onboard/cert |
| 105 | securityContext: |
| 106 | runAsUser: 0 |
| 107 | volumeMounts: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 108 | - name: cert-storage |
Krzysztof Kuzmicki | 868a280 | 2020-11-20 17:00:27 +0100 | [diff] [blame] | 109 | mountPath: "/onboard/cert" |
| 110 | resources: |
| 111 | limits: |
| 112 | cpu: 100m |
| 113 | memory: 100Mi |
| 114 | requests: |
| 115 | cpu: 3m |
| 116 | memory: 20Mi |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 117 | containers: |
| 118 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 119 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 120 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 121 | ports: |
| 122 | - containerPort: {{ .Values.service.internalPort }} |
| 123 | - containerPort: {{ .Values.service.internalPort2 }} |
| 124 | {{ if eq .Values.liveness.enabled true }} |
| 125 | livenessProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 126 | httpGet: |
| 127 | path: /onboarding-api/v1.0/healthcheck |
| 128 | port: {{ .Values.service.internalPort2 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 129 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 130 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Brian Freeman | 6142d94 | 2019-10-02 09:50:19 -0500 | [diff] [blame] | 131 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 132 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 133 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 134 | {{ end }} |
| 135 | readinessProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 136 | httpGet: |
| 137 | path: /onboarding-api/v1.0/healthcheck |
| 138 | port: {{ .Values.service.internalPort2 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 139 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 140 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 141 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
| 142 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 143 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
| 144 | startupProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 145 | httpGet: |
| 146 | path: /onboarding-api/v1.0/healthcheck |
| 147 | port: {{ .Values.service.internalPort2 }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 148 | initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }} |
| 149 | periodSeconds: {{ .Values.startup.periodSeconds }} |
| 150 | timeoutSeconds: {{ .Values.startup.timeoutSeconds }} |
| 151 | successThreshold: {{ .Values.startup.successThreshold }} |
| 152 | failureThreshold: {{ .Values.startup.failureThreshold }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 153 | resources: {{ include "common.resources" . | nindent 12 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 154 | env: |
| 155 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 156 | value: {{ .Values.env.name }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 157 | - name: JAVA_OPTIONS |
| 158 | value: {{ .Values.config.javaOptions }} |
| 159 | - name: SDC_CLUSTER_NAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 160 | value: "SDC-CS-{{ .Values.env.name }}" |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 161 | - name: cassandra_ssl_enabled |
| 162 | value: {{ .Values.config.cassandraSslEnabled | quote }} |
| 163 | - name: HOST_IP |
| 164 | valueFrom: |
| 165 | fieldRef: |
| 166 | fieldPath: status.podIP |
| 167 | - name: SDC_USER |
| 168 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 169 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 170 | - name: SDC_PASSWORD |
| 171 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 172 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password} |
kooper | 543d3aa | 2019-05-02 10:27:15 +0000 | [diff] [blame] | 173 | - name: SDC_CERT_DIR |
| 174 | value: {{ .Values.cert.certDir }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 175 | volumeMounts: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 176 | - name: sdc-environments |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 177 | mountPath: /app/jetty/chef-solo/environments/ |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 178 | {{- if .Values.global.aafEnabled }} |
| 179 | - name: sdc-environments |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 180 | mountPath: /app/jetty/chef-solo/cookbooks/sdc-onboard-backend/files/default/org.onap.sdc.p12 |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 181 | subPath: org.onap.sdc.p12 |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 182 | - name: sdc-environments |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 183 | mountPath: /app/jetty/chef-solo/cookbooks/sdc-onboard-backend/files/default/org.onap.sdc.trust.jks |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 184 | subPath: org.onap.sdc.trust.jks |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 185 | {{- end }} |
| 186 | - name: localtime |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 187 | mountPath: /etc/localtime |
| 188 | readOnly: true |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 189 | - name: logs |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 190 | mountPath: /var/log/onap |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 191 | - name: cert-storage |
sebdet | e33ecd1 | 2020-11-04 18:22:19 +0100 | [diff] [blame] | 192 | mountPath: "{{ .Values.cert.certDir }}" |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 193 | - name: logback |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 194 | mountPath: /tmp/logback.xml |
| 195 | subPath: logback.xml |
| 196 | lifecycle: |
| 197 | postStart: |
| 198 | exec: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 199 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/app/jetty/config/onboarding-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 | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 200 | # side car containers |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 201 | {{ include "common.log.sidecar" . | nindent 8 }} |
farida azmy | 1383b4c | 2021-04-06 12:33:31 +0200 | [diff] [blame] | 202 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 203 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 204 | - name: localtime |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 205 | hostPath: |
| 206 | path: /etc/localtime |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 207 | |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 208 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 209 | - name: logback |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 210 | configMap: |
| 211 | name : {{ include "common.fullname" . }}-logging-configmap |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 212 | - name: sdc-environments |
| 213 | {{- if .Values.global.aafEnabled }} |
| 214 | emptyDir: { medium: "Memory" } |
| 215 | - name: sdc-environments-input |
| 216 | {{- end }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 217 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 218 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 219 | defaultMode: 0755 |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 220 | - name: logs |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 221 | emptyDir: {} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 222 | - name: cert-storage |
sebdet | e33ecd1 | 2020-11-04 18:22:19 +0100 | [diff] [blame] | 223 | persistentVolumeClaim: |
| 224 | claimName: {{ include "common.fullname" . }}-cert |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 225 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 226 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |