Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 1 | # Copyright © 2018 Amdocs, AT&T, Bell Canada |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 15 | apiVersion: apps/v1 |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 16 | kind: Deployment |
| 17 | metadata: |
| 18 | name: {{ include "common.fullname" . }} |
| 19 | namespace: {{ include "common.namespace" . }} |
| 20 | labels: |
| 21 | app: {{ include "common.name" . }} |
| 22 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 23 | release: {{ include "common.release" . }} |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 26 | selector: |
| 27 | matchLabels: |
| 28 | app: {{ include "common.name" . }} |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 29 | replicas: {{ .Values.replicaCount }} |
| 30 | template: |
| 31 | metadata: |
| 32 | labels: |
| 33 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 34 | release: {{ include "common.release" . }} |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 35 | spec: |
| 36 | initContainers: |
| 37 | - name: {{ include "common.name" . }}-readiness |
| 38 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame^] | 39 | - /app/ready.py |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 40 | args: |
| 41 | - --container-name |
| 42 | - "sdc-be" |
| 43 | env: |
| 44 | - name: NAMESPACE |
| 45 | valueFrom: |
| 46 | fieldRef: |
| 47 | apiVersion: v1 |
| 48 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame^] | 49 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 50 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 51 | - name: {{ include "common.name" . }}-job-completion |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame^] | 52 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [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 |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 56 | args: |
| 57 | - --job-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 58 | - {{ include "common.release" . }}-sdc-be-config-backend |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 59 | env: |
| 60 | - name: NAMESPACE |
| 61 | valueFrom: |
| 62 | fieldRef: |
| 63 | apiVersion: v1 |
| 64 | fieldPath: metadata.namespace |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 65 | - name: {{ include "common.name" . }}-update-config |
| 66 | image: "{{ .Values.global.envsubstImage }}" |
| 67 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 68 | command: |
| 69 | - sh |
| 70 | args: |
| 71 | - -c |
| 72 | - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config-output/${PFILE}; chmod 0755 /config-output/${PFILE}; done" |
| 73 | env: |
| 74 | - name: KEYSTORE_PASS |
| 75 | valueFrom: |
| 76 | secretKeyRef: |
| 77 | name: {{ include "common.release" . }}-sdc-cs-secrets |
| 78 | key: keystore_password |
| 79 | - name: TRUSTSTORE_PASS |
| 80 | valueFrom: |
| 81 | secretKeyRef: |
| 82 | name: {{ include "common.release" . }}-sdc-cs-secrets |
| 83 | key: truststore_password |
| 84 | volumeMounts: |
| 85 | - name: {{ include "common.fullname" . }}-environments |
| 86 | mountPath: /config-input/ |
| 87 | - name: sdc-environments-output |
| 88 | mountPath: /config-output/ |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 89 | containers: |
| 90 | - name: {{ include "common.name" . }} |
| 91 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 92 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 93 | ports: |
| 94 | - containerPort: {{ .Values.service.internalPort }} |
| 95 | - containerPort: {{ .Values.service.internalPort2 }} |
| 96 | {{ if eq .Values.liveness.enabled true }} |
| 97 | livenessProbe: |
| 98 | tcpSocket: |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 99 | port: {{ .Values.service.internalPort2 }} |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 100 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 101 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 102 | {{ end }} |
| 103 | readinessProbe: |
| 104 | httpGet: |
| 105 | path: /dcae/conf/composition |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 106 | port: {{ .Values.service.internalPort2 }} |
| 107 | scheme: HTTPS |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 108 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 109 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 110 | env: |
| 111 | - name: ENVNAME |
| 112 | value: {{ .Values.global.env.name }} |
| 113 | - name: JAVA_OPTIONS |
| 114 | value: {{ .Values.config.javaOptions }} |
| 115 | - name: HOST_IP |
| 116 | valueFrom: |
| 117 | fieldRef: |
| 118 | fieldPath: status.podIP |
| 119 | volumeMounts: |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 120 | - name: sdc-environments-output |
MichaelMorris | b137f7e | 2020-03-15 17:44:48 +0000 | [diff] [blame] | 121 | mountPath: /var/lib/jetty/chef-solo/environments/ |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 122 | - name: sdc-cert |
| 123 | mountPath: /var/lib/jetty/chef-solo/cookbooks/Deploy-DCAE/files/default/org.onap.sdc.p12 |
| 124 | subPath: org.onap.sdc.p12 |
| 125 | - name: sdc-cert |
| 126 | mountPath: /var/lib/jetty/chef-solo/cookbooks/Deploy-DCAE/files/default/org.onap.sdc.trust.jks |
| 127 | subPath: org.onap.sdc.trust.jks |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 128 | - name: {{ include "common.fullname" . }}-localtime |
| 129 | mountPath: /etc/localtime |
| 130 | readOnly: true |
| 131 | - name: {{ include "common.fullname" . }}-logs |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 132 | mountPath: /var/lib/jetty/logs |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 133 | - name: {{ include "common.fullname" . }}-logback |
| 134 | mountPath: /tmp/logback.xml |
| 135 | subPath: logback.xml |
| 136 | lifecycle: |
| 137 | postStart: |
| 138 | exec: |
| 139 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/dcae-be/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"] |
| 140 | resources: |
| 141 | {{ include "common.resources" . | indent 12 }} |
| 142 | {{- if .Values.nodeSelector }} |
| 143 | nodeSelector: |
| 144 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 145 | {{- end -}} |
| 146 | {{- if .Values.affinity }} |
| 147 | affinity: |
| 148 | {{ toYaml .Values.affinity | indent 10 }} |
| 149 | {{- end }} |
| 150 | |
| 151 | # side car containers |
| 152 | - name: {{ include "common.name" . }}-filebeat-onap |
| 153 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 154 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 155 | volumeMounts: |
| 156 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 157 | mountPath: /usr/share/filebeat/filebeat.yml |
| 158 | subPath: filebeat.yml |
| 159 | - name: {{ include "common.fullname" . }}-logs |
| 160 | mountPath: /var/log/onap |
| 161 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 162 | mountPath: /usr/share/filebeat/data |
| 163 | volumes: |
| 164 | - name: {{ include "common.fullname" . }}-localtime |
| 165 | hostPath: |
| 166 | path: /etc/localtime |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 167 | - name: sdc-cert |
| 168 | secret: |
| 169 | secretName: sdc-cert |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 170 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 171 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 172 | name: {{ include "common.release" . }}-sdc-filebeat-configmap |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 173 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 174 | emptyDir: {} |
| 175 | - name: {{ include "common.fullname" . }}-logback |
| 176 | configMap: |
| 177 | name : {{ include "common.fullname" . }}-logging-configmap |
| 178 | - name: {{ include "common.fullname" . }}-environments |
| 179 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 180 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 181 | defaultMode: 0755 |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 182 | - name: sdc-environments-output |
| 183 | emptyDir: { medium: "Memory" } |
| 184 | - name: {{ include "common.fullname" . }}-logs |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 185 | emptyDir: {} |
| 186 | imagePullSecrets: |
| 187 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |