Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, AT&T, Bell Canada |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 ZTE |
Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 16 | apiVersion: apps/v1 |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 17 | kind: Deployment |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 18 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 19 | spec: |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 20 | selector: {{- include "common.selectors" . | nindent 4 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 21 | replicas: {{ .Values.replicaCount }} |
| 22 | template: |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 23 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 24 | spec: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 25 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 26 | - name: {{ include "common.name" . }}-readiness |
| 27 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 28 | - /app/ready.py |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 29 | args: |
| 30 | - --container-name |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 31 | - "sdc-onboarding-be" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 32 | env: |
| 33 | - name: NAMESPACE |
| 34 | valueFrom: |
| 35 | fieldRef: |
| 36 | apiVersion: v1 |
| 37 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 38 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 39 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 40 | resources: |
| 41 | limits: |
| 42 | cpu: 100m |
| 43 | memory: 100Mi |
| 44 | requests: |
| 45 | cpu: 3m |
| 46 | memory: 20Mi |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 47 | - name: {{ include "common.name" . }}-job-completion |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 48 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 49 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 50 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 51 | - /app/ready.py |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 52 | args: |
| 53 | - --job-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 54 | - {{ include "common.release" . }}-sdc-onboarding-be-cassandra-init |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 55 | env: |
| 56 | - name: NAMESPACE |
| 57 | valueFrom: |
| 58 | fieldRef: |
| 59 | apiVersion: v1 |
| 60 | fieldPath: metadata.namespace |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 61 | resources: |
| 62 | limits: |
| 63 | cpu: 100m |
| 64 | memory: 100Mi |
| 65 | requests: |
| 66 | cpu: 3m |
| 67 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 68 | {{- if .Values.global.aafEnabled }} |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 69 | - name: {{ include "common.name" . }}-update-config |
| 70 | image: "{{ .Values.global.envsubstImage }}" |
| 71 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 72 | command: |
| 73 | - sh |
| 74 | args: |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 75 | - "-c" |
| 76 | - | |
| 77 | export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
| 78 | export KEYSTORE_PASS=$cadi_keystore_password_p12 |
| 79 | export KEYMANAGER_PASS=$cadi_keystore_password_p12 |
| 80 | export TRUSTSTORE_PASS=$cadi_truststore_password |
| 81 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.keystoreFile }} /config-output |
| 82 | cp {{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.truststoreFile }} /config-output |
| 83 | cd /config-input && \ |
| 84 | for PFILE in `find . -not -type d | grep -v -F ..` |
| 85 | do |
| 86 | envsubst <${PFILE} >/config-output/${PFILE} |
| 87 | chmod 0755 /config-output/${PFILE} |
| 88 | done |
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 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }} |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 97 | - name: {{ include "common.fullname" . }}-environments |
| 98 | mountPath: /config-input/ |
| 99 | - name: sdc-environments-output |
| 100 | mountPath: /config-output/ |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 101 | {{- end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 102 | containers: |
| 103 | - name: {{ include "common.name" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 104 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 105 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 106 | {{- if .Values.global.aafEnabled }} |
| 107 | command: |
| 108 | - sh |
| 109 | args: |
| 110 | - "-c" |
| 111 | - | |
| 112 | sed -i '/trustStorePassword/d' ${JETTY_BASE}/startup.sh |
| 113 | ${JETTY_BASE}/startup.sh |
| 114 | {{- end }} |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 115 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 116 | {{ if eq .Values.liveness.enabled true }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 117 | livenessProbe: |
Yang Xu | e5d5e68 | 2019-06-19 18:20:31 -0400 | [diff] [blame] | 118 | httpGet: |
shrek2000 | f336f6d | 2020-02-25 16:11:26 +0200 | [diff] [blame] | 119 | path: /sdc2/rest/healthCheck |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 120 | port: {{ .Values.liveness.port }} |
| 121 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 122 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 123 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Yang Xu | 8560854 | 2019-06-16 23:25:32 -0400 | [diff] [blame] | 124 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 125 | {{ end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 126 | readinessProbe: |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 127 | exec: |
| 128 | command: |
MichaelMorris | b137f7e | 2020-03-15 17:44:48 +0000 | [diff] [blame] | 129 | - "/var/lib/jetty/ready-probe.sh" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 130 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 131 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Yang Xu | 8560854 | 2019-06-16 23:25:32 -0400 | [diff] [blame] | 132 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 133 | resources: {{ include "common.resources" . | nindent 12 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 134 | env: |
| 135 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 136 | value: {{ .Values.env.name }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 137 | - name: JAVA_OPTIONS |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 138 | value: {{ .Values.config.javaOptions }} |
| 139 | - name: cassandra_ssl_enabled |
| 140 | value: {{ .Values.config.cassandraSslEnabled | quote }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 141 | - name: HOST_IP |
| 142 | valueFrom: |
| 143 | fieldRef: |
| 144 | fieldPath: status.podIP |
| 145 | volumeMounts: |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 146 | - name: sdc-environments-output |
MichaelMorris | b137f7e | 2020-03-15 17:44:48 +0000 | [diff] [blame] | 147 | mountPath: /var/lib/jetty/chef-solo/environments/ |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 148 | - name: sdc-environments-output |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 149 | mountPath: /var/lib/jetty/chef-solo/cookbooks/sdc-catalog-be/files/default/org.onap.sdc.p12 |
| 150 | subPath: org.onap.sdc.p12 |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 151 | - name: sdc-environments-output |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 152 | mountPath: /var/lib/jetty/chef-solo/cookbooks/sdc-catalog-be/files/default/org.onap.sdc.trust.jks |
| 153 | subPath: org.onap.sdc.trust.jks |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 154 | - name: {{ include "common.fullname" . }}-localtime |
| 155 | mountPath: /etc/localtime |
| 156 | readOnly: true |
| 157 | - name: {{ include "common.fullname" . }}-logs |
| 158 | mountPath: /var/log/onap |
| 159 | - name: {{ include "common.fullname" . }}-logback |
| 160 | mountPath: /tmp/logback.xml |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 161 | subPath: logback.xml |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 162 | lifecycle: |
| 163 | postStart: |
| 164 | exec: |
| 165 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/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] | 166 | # side car containers |
| 167 | - name: {{ include "common.name" . }}-filebeat-onap |
| 168 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 169 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 170 | volumeMounts: |
| 171 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 172 | mountPath: /usr/share/filebeat/filebeat.yml |
| 173 | subPath: filebeat.yml |
| 174 | - name: {{ include "common.fullname" . }}-logs |
| 175 | mountPath: /var/log/onap |
| 176 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 177 | mountPath: /usr/share/filebeat/data |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 178 | resources: |
| 179 | limits: |
| 180 | cpu: 100m |
| 181 | memory: 100Mi |
| 182 | requests: |
| 183 | cpu: 3m |
| 184 | memory: 20Mi |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 185 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 186 | - name: {{ include "common.fullname" . }}-localtime |
| 187 | hostPath: |
| 188 | path: /etc/localtime |
| 189 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 190 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 191 | name: {{ include "common.release" . }}-sdc-filebeat-configmap |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 192 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 193 | emptyDir: {} |
| 194 | - name: {{ include "common.fullname" . }}-logback |
| 195 | configMap: |
| 196 | name : {{ include "common.fullname" . }}-logging-configmap |
| 197 | - name: {{ include "common.fullname" . }}-environments |
| 198 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 199 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 200 | defaultMode: 0755 |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 201 | - name: sdc-environments-output |
| 202 | emptyDir: { medium: "Memory" } |
| 203 | - name: {{ include "common.fullname" . }}-logs |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 204 | emptyDir: {} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 205 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 206 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |