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 |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +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 | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 17 | |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 18 | apiVersion: apps/v1 |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +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 | 51a8b1b | 2018-04-24 20:05:32 +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 | 51a8b1b | 2018-04-24 20:05:32 +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 | 51a8b1b | 2018-04-24 20:05:32 +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-onboarding-be-cassandra-init |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 48 | env: |
| 49 | - name: NAMESPACE |
| 50 | valueFrom: |
| 51 | fieldRef: |
| 52 | apiVersion: v1 |
| 53 | fieldPath: metadata.namespace |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 54 | resources: |
| 55 | limits: |
| 56 | cpu: 100m |
| 57 | memory: 100Mi |
| 58 | requests: |
| 59 | cpu: 3m |
| 60 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 61 | {{- if .Values.global.aafEnabled }} |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 62 | - name: {{ include "common.name" . }}-update-config |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 63 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 64 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 65 | command: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 66 | - sh |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 67 | args: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 68 | - "-c" |
| 69 | - | |
| 70 | export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
| 71 | export KEYSTORE_PASS=$cadi_keystore_password_p12 |
| 72 | export KEYMANAGER_PASS=$cadi_keystore_password_p12 |
| 73 | export TRUSTSTORE_PASS=$cadi_truststore_password |
| 74 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /config-output |
| 75 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /config-output |
| 76 | cd /config-input && \ |
| 77 | for PFILE in `find . -not -type d | grep -v -F ..` |
| 78 | do |
| 79 | envsubst <${PFILE} >/config-output/${PFILE} |
| 80 | chmod 0755 /config-output/${PFILE} |
| 81 | done |
| 82 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 83 | - name: {{ include "common.fullname" . }}-environments |
| 84 | mountPath: /config-input/ |
| 85 | - name: sdc-environments-output |
| 86 | mountPath: /config-output/ |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 87 | resources: |
| 88 | limits: |
| 89 | cpu: 100m |
| 90 | memory: 100Mi |
| 91 | requests: |
| 92 | cpu: 3m |
| 93 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 94 | {{- end }} |
Krzysztof Kuzmicki | 868a280 | 2020-11-20 17:00:27 +0100 | [diff] [blame] | 95 | - name: volume-permissions |
Sylvain Desbureaux | 80f32ff | 2021-05-03 15:24:59 +0200 | [diff] [blame] | 96 | image: {{ include "repositoryGenerator.image.busybox" . }} |
Krzysztof Kuzmicki | 868a280 | 2020-11-20 17:00:27 +0100 | [diff] [blame] | 97 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 98 | command: |
| 99 | - sh |
| 100 | args: |
| 101 | - "-c" |
| 102 | - | |
| 103 | chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} //onboard/cert |
| 104 | securityContext: |
| 105 | runAsUser: 0 |
| 106 | volumeMounts: |
| 107 | - name: {{ include "common.fullname" . }}-cert-storage |
| 108 | mountPath: "/onboard/cert" |
| 109 | resources: |
| 110 | limits: |
| 111 | cpu: 100m |
| 112 | memory: 100Mi |
| 113 | requests: |
| 114 | cpu: 3m |
| 115 | memory: 20Mi |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 116 | containers: |
| 117 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 118 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 119 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 120 | ports: |
| 121 | - containerPort: {{ .Values.service.internalPort }} |
| 122 | - containerPort: {{ .Values.service.internalPort2 }} |
| 123 | {{ if eq .Values.liveness.enabled true }} |
| 124 | livenessProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 125 | httpGet: |
| 126 | path: /onboarding-api/v1.0/healthcheck |
| 127 | port: {{ .Values.service.internalPort2 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 128 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 129 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Brian Freeman | 6142d94 | 2019-10-02 09:50:19 -0500 | [diff] [blame] | 130 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 131 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 132 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 133 | {{ end }} |
| 134 | readinessProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 135 | httpGet: |
| 136 | path: /onboarding-api/v1.0/healthcheck |
| 137 | port: {{ .Values.service.internalPort2 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 138 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 139 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 140 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
| 141 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 142 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
| 143 | startupProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 144 | httpGet: |
| 145 | path: /onboarding-api/v1.0/healthcheck |
| 146 | port: {{ .Values.service.internalPort2 }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 147 | initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }} |
| 148 | periodSeconds: {{ .Values.startup.periodSeconds }} |
| 149 | timeoutSeconds: {{ .Values.startup.timeoutSeconds }} |
| 150 | successThreshold: {{ .Values.startup.successThreshold }} |
| 151 | failureThreshold: {{ .Values.startup.failureThreshold }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 152 | resources: {{ include "common.resources" . | nindent 12 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 153 | env: |
| 154 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 155 | value: {{ .Values.env.name }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 156 | - name: JAVA_OPTIONS |
| 157 | value: {{ .Values.config.javaOptions }} |
| 158 | - name: SDC_CLUSTER_NAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 159 | value: "SDC-CS-{{ .Values.env.name }}" |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 160 | - name: cassandra_ssl_enabled |
| 161 | value: {{ .Values.config.cassandraSslEnabled | quote }} |
| 162 | - name: HOST_IP |
| 163 | valueFrom: |
| 164 | fieldRef: |
| 165 | fieldPath: status.podIP |
| 166 | - name: SDC_USER |
| 167 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 168 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 169 | - name: SDC_PASSWORD |
| 170 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 171 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password} |
kooper | 543d3aa | 2019-05-02 10:27:15 +0000 | [diff] [blame] | 172 | - name: SDC_CERT_DIR |
| 173 | value: {{ .Values.cert.certDir }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 174 | volumeMounts: |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 175 | - name: sdc-environments-output |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 176 | mountPath: /app/jetty/chef-solo/environments/ |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 177 | - name: sdc-environments-output |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 178 | 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] | 179 | subPath: org.onap.sdc.p12 |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 180 | - name: sdc-environments-output |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 181 | 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] | 182 | subPath: org.onap.sdc.trust.jks |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 183 | - name: {{ include "common.fullname" . }}-localtime |
| 184 | mountPath: /etc/localtime |
| 185 | readOnly: true |
| 186 | - name: {{ include "common.fullname" . }}-logs |
| 187 | mountPath: /var/log/onap |
sebdet | e33ecd1 | 2020-11-04 18:22:19 +0100 | [diff] [blame] | 188 | - name: {{ include "common.fullname" . }}-cert-storage |
| 189 | mountPath: "{{ .Values.cert.certDir }}" |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 190 | - name: {{ include "common.fullname" . }}-logback |
| 191 | mountPath: /tmp/logback.xml |
| 192 | subPath: logback.xml |
| 193 | lifecycle: |
| 194 | postStart: |
| 195 | exec: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 196 | 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] | 197 | # side car containers |
| 198 | - name: {{ include "common.name" . }}-filebeat-onap |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 199 | image: {{ include "repositoryGenerator.image.logging" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 200 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 201 | volumeMounts: |
| 202 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 203 | mountPath: /usr/share/filebeat/filebeat.yml |
| 204 | subPath: filebeat.yml |
| 205 | - name: {{ include "common.fullname" . }}-logs |
| 206 | mountPath: /var/log/onap |
| 207 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 208 | mountPath: /usr/share/filebeat/data |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 209 | resources: |
| 210 | limits: |
| 211 | cpu: 100m |
| 212 | memory: 100Mi |
| 213 | requests: |
| 214 | cpu: 3m |
| 215 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 216 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 217 | - name: {{ include "common.fullname" . }}-localtime |
| 218 | hostPath: |
| 219 | path: /etc/localtime |
| 220 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 221 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 222 | name: {{ include "common.release" . }}-sdc-filebeat-configmap |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 223 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 224 | emptyDir: {} |
| 225 | - name: {{ include "common.fullname" . }}-logback |
| 226 | configMap: |
| 227 | name : {{ include "common.fullname" . }}-logging-configmap |
| 228 | - name: {{ include "common.fullname" . }}-environments |
| 229 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 230 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 231 | defaultMode: 0755 |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 232 | - name: sdc-environments-output |
| 233 | emptyDir: { medium: "Memory" } |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 234 | - name: {{ include "common.fullname" . }}-logs |
| 235 | emptyDir: {} |
sebdet | e33ecd1 | 2020-11-04 18:22:19 +0100 | [diff] [blame] | 236 | - name: {{ include "common.fullname" . }}-cert-storage |
| 237 | persistentVolumeClaim: |
| 238 | claimName: {{ include "common.fullname" . }}-cert |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 239 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 240 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |