Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 1 | # Copyright © 2017 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 | |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 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 "+" "_" }} |
| 23 | release: {{ .Release.Name }} |
| 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
| 26 | replicas: {{ .Values.replicaCount }} |
| 27 | template: |
| 28 | metadata: |
| 29 | labels: |
| 30 | app: {{ include "common.name" . }} |
| 31 | release: {{ .Release.Name }} |
| 32 | spec: |
| 33 | initContainers: |
| 34 | - name: {{ include "common.name" . }}-readiness |
| 35 | command: |
| 36 | - /root/ready.py |
| 37 | args: |
| 38 | - --container-name |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 39 | - "sdc-onboarding-be" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 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 |
Mike Elliott | 6482f50 | 2018-04-30 15:02:43 -0400 | [diff] [blame] | 55 | - {{ .Release.Name }}-sdc-es-config-elasticsearch |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 56 | env: |
| 57 | - name: NAMESPACE |
| 58 | valueFrom: |
| 59 | fieldRef: |
| 60 | apiVersion: v1 |
| 61 | fieldPath: metadata.namespace |
| 62 | containers: |
| 63 | - name: {{ include "common.name" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 64 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 65 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 66 | ports: |
| 67 | - containerPort: {{ .Values.service.internalPort }} |
| 68 | - containerPort: {{ .Values.service.internalPort2 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 69 | {{ if eq .Values.liveness.enabled true }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 70 | livenessProbe: |
| 71 | tcpSocket: |
| 72 | port: {{ .Values.service.internalPort }} |
| 73 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 74 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 75 | {{ end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 76 | readinessProbe: |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 77 | exec: |
| 78 | command: |
| 79 | - "/var/lib/ready-probe.sh" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 80 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 81 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 82 | env: |
| 83 | - name: ENVNAME |
| 84 | value: {{ .Values.global.env.name }} |
| 85 | - name: JAVA_OPTIONS |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 86 | value: {{ .Values.config.javaOptions }} |
| 87 | - name: cassandra_ssl_enabled |
| 88 | value: {{ .Values.config.cassandraSslEnabled | quote }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 89 | - name: HOST_IP |
| 90 | valueFrom: |
| 91 | fieldRef: |
| 92 | fieldPath: status.podIP |
| 93 | volumeMounts: |
| 94 | - name: {{ include "common.fullname" . }}-environments |
| 95 | mountPath: /root/chef-solo/environments/ |
| 96 | - name: {{ include "common.fullname" . }}-localtime |
| 97 | mountPath: /etc/localtime |
| 98 | readOnly: true |
| 99 | - name: {{ include "common.fullname" . }}-logs |
| 100 | mountPath: /var/log/onap |
| 101 | - name: {{ include "common.fullname" . }}-logback |
| 102 | mountPath: /tmp/logback.xml |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 103 | subPath: logback.xml |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 104 | lifecycle: |
| 105 | postStart: |
| 106 | exec: |
| 107 | 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"] |
| 108 | resources: |
| 109 | {{ toYaml .Values.resources | indent 12 }} |
| 110 | {{- if .Values.nodeSelector }} |
| 111 | nodeSelector: |
| 112 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 113 | {{- end -}} |
| 114 | {{- if .Values.affinity }} |
| 115 | affinity: |
| 116 | {{ toYaml .Values.affinity | indent 10 }} |
| 117 | {{- end }} |
| 118 | |
| 119 | # side car containers |
| 120 | - name: {{ include "common.name" . }}-filebeat-onap |
| 121 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 122 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 123 | volumeMounts: |
| 124 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 125 | mountPath: /usr/share/filebeat/filebeat.yml |
| 126 | subPath: filebeat.yml |
| 127 | - name: {{ include "common.fullname" . }}-logs |
| 128 | mountPath: /var/log/onap |
| 129 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 130 | mountPath: /usr/share/filebeat/data |
| 131 | volumes: |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 132 | - name: {{ include "common.fullname" . }}-localtime |
| 133 | hostPath: |
| 134 | path: /etc/localtime |
| 135 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 136 | configMap: |
| 137 | name: {{ .Release.Name }}-sdc-filebeat-configmap |
| 138 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 139 | emptyDir: {} |
| 140 | - name: {{ include "common.fullname" . }}-logback |
| 141 | configMap: |
| 142 | name : {{ include "common.fullname" . }}-logging-configmap |
| 143 | - name: {{ include "common.fullname" . }}-environments |
| 144 | configMap: |
| 145 | name: {{ .Release.Name }}-sdc-environments-configmap |
| 146 | defaultMode: 0755 |
| 147 | - name: {{ include "common.fullname" . }}-logs |
| 148 | emptyDir: {} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 149 | imagePullSecrets: |
| 150 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |