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 | |
| 15 | apiVersion: extensions/v1beta1 |
| 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: |
| 26 | replicas: {{ .Values.replicaCount }} |
| 27 | template: |
| 28 | metadata: |
| 29 | labels: |
| 30 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 31 | release: {{ include "common.release" . }} |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 32 | spec: |
| 33 | initContainers: |
| 34 | - name: {{ include "common.name" . }}-readiness |
| 35 | command: |
| 36 | - /root/ready.py |
| 37 | args: |
| 38 | - --container-name |
| 39 | - "sdc-be" |
| 40 | env: |
| 41 | - name: NAMESPACE |
| 42 | valueFrom: |
| 43 | fieldRef: |
| 44 | apiVersion: v1 |
| 45 | fieldPath: metadata.namespace |
| 46 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 47 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 48 | - name: {{ include "common.name" . }}-job-completion |
| 49 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 50 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 51 | command: |
| 52 | - /root/job_complete.py |
| 53 | args: |
| 54 | - --job-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 55 | - {{ include "common.release" . }}-sdc-be-config-backend |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 56 | env: |
| 57 | - name: NAMESPACE |
| 58 | valueFrom: |
| 59 | fieldRef: |
| 60 | apiVersion: v1 |
| 61 | fieldPath: metadata.namespace |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 62 | - name: {{ include "common.name" . }}-update-config |
| 63 | image: "{{ .Values.global.envsubstImage }}" |
| 64 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 65 | command: |
| 66 | - sh |
| 67 | args: |
| 68 | - -c |
| 69 | - "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" |
| 70 | env: |
| 71 | - name: KEYSTORE_PASS |
| 72 | valueFrom: |
| 73 | secretKeyRef: |
| 74 | name: {{ include "common.release" . }}-sdc-cs-secrets |
| 75 | key: keystore_password |
| 76 | - name: TRUSTSTORE_PASS |
| 77 | valueFrom: |
| 78 | secretKeyRef: |
| 79 | name: {{ include "common.release" . }}-sdc-cs-secrets |
| 80 | key: truststore_password |
| 81 | volumeMounts: |
| 82 | - name: {{ include "common.fullname" . }}-environments |
| 83 | mountPath: /config-input/ |
| 84 | - name: sdc-environments-output |
| 85 | mountPath: /config-output/ |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 86 | containers: |
| 87 | - name: {{ include "common.name" . }} |
| 88 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 89 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 90 | ports: |
| 91 | - containerPort: {{ .Values.service.internalPort }} |
| 92 | - containerPort: {{ .Values.service.internalPort2 }} |
| 93 | {{ if eq .Values.liveness.enabled true }} |
| 94 | livenessProbe: |
| 95 | tcpSocket: |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 96 | port: {{ .Values.service.internalPort2 }} |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 97 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 98 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 99 | {{ end }} |
| 100 | readinessProbe: |
| 101 | httpGet: |
| 102 | path: /dcae/conf/composition |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 103 | port: {{ .Values.service.internalPort2 }} |
| 104 | scheme: HTTPS |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 105 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 106 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 107 | env: |
| 108 | - name: ENVNAME |
| 109 | value: {{ .Values.global.env.name }} |
| 110 | - name: JAVA_OPTIONS |
| 111 | value: {{ .Values.config.javaOptions }} |
| 112 | - name: HOST_IP |
| 113 | valueFrom: |
| 114 | fieldRef: |
| 115 | fieldPath: status.podIP |
| 116 | volumeMounts: |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 117 | - name: sdc-environments-output |
MichaelMorris | b137f7e | 2020-03-15 17:44:48 +0000 | [diff] [blame] | 118 | mountPath: /var/lib/jetty/chef-solo/environments/ |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 119 | - name: sdc-cert |
| 120 | mountPath: /var/lib/jetty/chef-solo/cookbooks/Deploy-DCAE/files/default/org.onap.sdc.p12 |
| 121 | subPath: org.onap.sdc.p12 |
| 122 | - name: sdc-cert |
| 123 | mountPath: /var/lib/jetty/chef-solo/cookbooks/Deploy-DCAE/files/default/org.onap.sdc.trust.jks |
| 124 | subPath: org.onap.sdc.trust.jks |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 125 | - name: {{ include "common.fullname" . }}-localtime |
| 126 | mountPath: /etc/localtime |
| 127 | readOnly: true |
| 128 | - name: {{ include "common.fullname" . }}-logs |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 129 | mountPath: /var/lib/jetty/logs |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 130 | - name: {{ include "common.fullname" . }}-logback |
| 131 | mountPath: /tmp/logback.xml |
| 132 | subPath: logback.xml |
| 133 | lifecycle: |
| 134 | postStart: |
| 135 | exec: |
| 136 | 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"] |
| 137 | resources: |
| 138 | {{ include "common.resources" . | indent 12 }} |
| 139 | {{- if .Values.nodeSelector }} |
| 140 | nodeSelector: |
| 141 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 142 | {{- end -}} |
| 143 | {{- if .Values.affinity }} |
| 144 | affinity: |
| 145 | {{ toYaml .Values.affinity | indent 10 }} |
| 146 | {{- end }} |
| 147 | |
| 148 | # side car containers |
| 149 | - name: {{ include "common.name" . }}-filebeat-onap |
| 150 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 151 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 152 | volumeMounts: |
| 153 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 154 | mountPath: /usr/share/filebeat/filebeat.yml |
| 155 | subPath: filebeat.yml |
| 156 | - name: {{ include "common.fullname" . }}-logs |
| 157 | mountPath: /var/log/onap |
| 158 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 159 | mountPath: /usr/share/filebeat/data |
| 160 | volumes: |
| 161 | - name: {{ include "common.fullname" . }}-localtime |
| 162 | hostPath: |
| 163 | path: /etc/localtime |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 164 | - name: sdc-cert |
| 165 | secret: |
| 166 | secretName: sdc-cert |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 167 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 168 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 169 | name: {{ include "common.release" . }}-sdc-filebeat-configmap |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 170 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 171 | emptyDir: {} |
| 172 | - name: {{ include "common.fullname" . }}-logback |
| 173 | configMap: |
| 174 | name : {{ include "common.fullname" . }}-logging-configmap |
| 175 | - name: {{ include "common.fullname" . }}-environments |
| 176 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 177 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 178 | defaultMode: 0755 |
k.kedron | 2774ab1 | 2020-03-26 11:13:46 +0100 | [diff] [blame] | 179 | - name: sdc-environments-output |
| 180 | emptyDir: { medium: "Memory" } |
| 181 | - name: {{ include "common.fullname" . }}-logs |
Areli, Fuss (af732p) | 307fdc7 | 2018-05-29 14:40:03 +0300 | [diff] [blame] | 182 | emptyDir: {} |
| 183 | imagePullSecrets: |
| 184 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |