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 | |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 16 | apiVersion: extensions/v1beta1 |
| 17 | kind: Deployment |
| 18 | metadata: |
| 19 | name: {{ include "common.fullname" . }} |
| 20 | namespace: {{ include "common.namespace" . }} |
| 21 | labels: |
| 22 | app: {{ include "common.name" . }} |
| 23 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 24 | release: {{ include "common.release" . }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
| 27 | replicas: {{ .Values.replicaCount }} |
| 28 | template: |
| 29 | metadata: |
| 30 | labels: |
| 31 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 32 | release: {{ include "common.release" . }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 33 | spec: |
| 34 | initContainers: |
| 35 | - name: {{ include "common.name" . }}-readiness |
| 36 | command: |
| 37 | - /root/ready.py |
| 38 | args: |
| 39 | - --container-name |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 40 | - "sdc-onboarding-be" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 41 | env: |
| 42 | - name: NAMESPACE |
| 43 | valueFrom: |
| 44 | fieldRef: |
| 45 | apiVersion: v1 |
| 46 | fieldPath: metadata.namespace |
| 47 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 48 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 49 | - name: {{ include "common.name" . }}-job-completion |
| 50 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 51 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 52 | command: |
| 53 | - /root/job_complete.py |
| 54 | args: |
| 55 | - --job-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 56 | - {{ include "common.release" . }}-sdc-onboarding-be-cassandra-init |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 57 | env: |
| 58 | - name: NAMESPACE |
| 59 | valueFrom: |
| 60 | fieldRef: |
| 61 | apiVersion: v1 |
| 62 | fieldPath: metadata.namespace |
| 63 | containers: |
| 64 | - name: {{ include "common.name" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 65 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 67 | ports: |
| 68 | - containerPort: {{ .Values.service.internalPort }} |
| 69 | - containerPort: {{ .Values.service.internalPort2 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 70 | {{ if eq .Values.liveness.enabled true }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 71 | livenessProbe: |
Yang Xu | e5d5e68 | 2019-06-19 18:20:31 -0400 | [diff] [blame] | 72 | httpGet: |
shrek2000 | f336f6d | 2020-02-25 16:11:26 +0200 | [diff] [blame^] | 73 | path: /sdc2/rest/healthCheck |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 74 | port: {{ .Values.service.internalPort }} |
| 75 | scheme: HTTPS |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 76 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 77 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Yang Xu | 8560854 | 2019-06-16 23:25:32 -0400 | [diff] [blame] | 78 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 79 | {{ end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 80 | readinessProbe: |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 81 | exec: |
| 82 | command: |
| 83 | - "/var/lib/ready-probe.sh" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 84 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 85 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Yang Xu | 8560854 | 2019-06-16 23:25:32 -0400 | [diff] [blame] | 86 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
Mukul | a93baa8 | 2018-09-19 15:56:58 +0000 | [diff] [blame] | 87 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 88 | {{ include "common.resources" . | indent 12 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 89 | env: |
| 90 | - name: ENVNAME |
| 91 | value: {{ .Values.global.env.name }} |
| 92 | - name: JAVA_OPTIONS |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 93 | value: {{ .Values.config.javaOptions }} |
| 94 | - name: cassandra_ssl_enabled |
| 95 | value: {{ .Values.config.cassandraSslEnabled | quote }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 96 | - name: HOST_IP |
| 97 | valueFrom: |
| 98 | fieldRef: |
| 99 | fieldPath: status.podIP |
| 100 | volumeMounts: |
| 101 | - name: {{ include "common.fullname" . }}-environments |
| 102 | mountPath: /root/chef-solo/environments/ |
| 103 | - name: {{ include "common.fullname" . }}-localtime |
| 104 | mountPath: /etc/localtime |
| 105 | readOnly: true |
| 106 | - name: {{ include "common.fullname" . }}-logs |
| 107 | mountPath: /var/log/onap |
| 108 | - name: {{ include "common.fullname" . }}-logback |
| 109 | mountPath: /tmp/logback.xml |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 110 | subPath: logback.xml |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 111 | lifecycle: |
| 112 | postStart: |
| 113 | exec: |
| 114 | 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] | 115 | # side car containers |
| 116 | - name: {{ include "common.name" . }}-filebeat-onap |
| 117 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 118 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 119 | volumeMounts: |
| 120 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 121 | mountPath: /usr/share/filebeat/filebeat.yml |
| 122 | subPath: filebeat.yml |
| 123 | - name: {{ include "common.fullname" . }}-logs |
| 124 | mountPath: /var/log/onap |
| 125 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 126 | mountPath: /usr/share/filebeat/data |
| 127 | volumes: |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 128 | - name: {{ include "common.fullname" . }}-localtime |
| 129 | hostPath: |
| 130 | path: /etc/localtime |
| 131 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 132 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 133 | name: {{ include "common.release" . }}-sdc-filebeat-configmap |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 134 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 135 | emptyDir: {} |
| 136 | - name: {{ include "common.fullname" . }}-logback |
| 137 | configMap: |
| 138 | name : {{ include "common.fullname" . }}-logging-configmap |
| 139 | - name: {{ include "common.fullname" . }}-environments |
| 140 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 141 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 142 | defaultMode: 0755 |
| 143 | - name: {{ include "common.fullname" . }}-logs |
| 144 | emptyDir: {} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 145 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 146 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |