Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 AT&T, 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 "+" "_" }} |
| 24 | release: {{ .Release.Name }} |
| 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
| 27 | replicas: {{ .Values.replicaCount }} |
| 28 | template: |
| 29 | metadata: |
| 30 | labels: |
| 31 | app: {{ include "common.name" . }} |
| 32 | release: {{ .Release.Name }} |
| 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-kb" |
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 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 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 |
| 56 | - {{ .Release.Name }}-sdc-be-config-backend |
| 57 | env: |
| 58 | - name: NAMESPACE |
| 59 | valueFrom: |
| 60 | fieldRef: |
| 61 | apiVersion: v1 |
| 62 | fieldPath: metadata.namespace |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 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 | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 70 | {{ if eq .Values.liveness.enabled true }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 71 | livenessProbe: |
| 72 | tcpSocket: |
| 73 | port: {{ .Values.service.internalPort }} |
| 74 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 75 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 76 | {{ end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 77 | readinessProbe: |
| 78 | tcpSocket: |
| 79 | port: {{ .Values.service.internalPort }} |
| 80 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 81 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 82 | env: |
| 83 | - name: ENVNAME |
| 84 | value: {{ .Values.global.env.name }} |
| 85 | - name: HOST_IP |
| 86 | valueFrom: |
| 87 | fieldRef: |
| 88 | fieldPath: status.podIP |
| 89 | - name: JAVA_OPTIONS |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 90 | value: {{ .Values.config.javaOptions }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 91 | volumeMounts: |
| 92 | - name: {{ include "common.fullname" . }}-environments |
| 93 | mountPath: /root/chef-solo/environments/ |
| 94 | - name: {{ include "common.fullname" . }}-localtime |
| 95 | mountPath: /etc/localtime |
| 96 | readOnly: true |
| 97 | - name: {{ include "common.fullname" . }}-logs |
| 98 | mountPath: /var/log/onap |
| 99 | - name: {{ include "common.fullname" . }}-logback |
| 100 | mountPath: /tmp/logback.xml |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 101 | subPath: logback.xml |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 102 | lifecycle: |
| 103 | postStart: |
| 104 | exec: |
| 105 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/catalog-fe/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"] |
| 106 | resources: |
| 107 | {{ toYaml .Values.resources | indent 12 }} |
| 108 | {{- if .Values.nodeSelector }} |
| 109 | nodeSelector: |
| 110 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 111 | {{- end -}} |
| 112 | {{- if .Values.affinity }} |
| 113 | affinity: |
| 114 | {{ toYaml .Values.affinity | indent 10 }} |
| 115 | {{- end }} |
| 116 | |
| 117 | # side car containers |
| 118 | - name: {{ include "common.name" . }}-filebeat-onap |
| 119 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 120 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 121 | volumeMounts: |
| 122 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 123 | mountPath: /usr/share/filebeat/filebeat.yml |
| 124 | subPath: filebeat.yml |
| 125 | - name: {{ include "common.fullname" . }}-logs |
| 126 | mountPath: /var/log/onap |
| 127 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 128 | mountPath: /usr/share/filebeat/data |
| 129 | volumes: |
| 130 | - name: {{ include "common.fullname" . }}-localtime |
| 131 | hostPath: |
| 132 | path: /etc/localtime |
| 133 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 134 | configMap: |
| 135 | name: {{ .Release.Name }}-sdc-filebeat-configmap |
| 136 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 137 | emptyDir: {} |
| 138 | - name: {{ include "common.fullname" . }}-logback |
| 139 | configMap: |
| 140 | name : {{ include "common.fullname" . }}-logging-configmap |
| 141 | - name: {{ include "common.fullname" . }}-environments |
| 142 | configMap: |
| 143 | name: {{ .Release.Name }}-sdc-environments-configmap |
| 144 | defaultMode: 0755 |
| 145 | - name: {{ include "common.fullname" . }}-logs |
| 146 | emptyDir: {} |
| 147 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 148 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |