blob: 58095e719718e9d9e89941360f330d8bd6ff4e59 [file] [log] [blame]
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00001# Copyright © 2017 Amdocs, AT&T, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 ZTE
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00003#
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 Khindaa1047f42018-03-22 02:12:15 +000016apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
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 }}
26spec:
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 Khinda51a8b1b2018-04-24 20:05:32 +000040 - "sdc-onboarding-be"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000041 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
Mike Elliott6482f502018-04-30 15:02:43 -040056 - {{ .Release.Name }}-sdc-es-config-elasticsearch
Mandeep Khindaa1047f42018-03-22 02:12:15 +000057 env:
58 - name: NAMESPACE
59 valueFrom:
60 fieldRef:
61 apiVersion: v1
62 fieldPath: metadata.namespace
63 containers:
64 - name: {{ include "common.name" . }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000065 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000066 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67 ports:
68 - containerPort: {{ .Values.service.internalPort }}
69 - containerPort: {{ .Values.service.internalPort2 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000070 {{ if eq .Values.liveness.enabled true }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000071 livenessProbe:
72 tcpSocket:
73 port: {{ .Values.service.internalPort }}
74 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.liveness.periodSeconds }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000076 {{ end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000077 readinessProbe:
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000078 exec:
79 command:
80 - "/var/lib/ready-probe.sh"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000081 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
82 periodSeconds: {{ .Values.readiness.periodSeconds }}
83 env:
84 - name: ENVNAME
85 value: {{ .Values.global.env.name }}
86 - name: JAVA_OPTIONS
Mandeep Khinda403c1c12018-04-19 23:15:43 +000087 value: {{ .Values.config.javaOptions }}
88 - name: cassandra_ssl_enabled
89 value: {{ .Values.config.cassandraSslEnabled | quote }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000090 - name: HOST_IP
91 valueFrom:
92 fieldRef:
93 fieldPath: status.podIP
94 volumeMounts:
95 - name: {{ include "common.fullname" . }}-environments
96 mountPath: /root/chef-solo/environments/
97 - name: {{ include "common.fullname" . }}-localtime
98 mountPath: /etc/localtime
99 readOnly: true
100 - name: {{ include "common.fullname" . }}-logs
101 mountPath: /var/log/onap
102 - name: {{ include "common.fullname" . }}-logback
103 mountPath: /tmp/logback.xml
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000104 subPath: logback.xml
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000105 lifecycle:
106 postStart:
107 exec:
108 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"]
109 resources:
110{{ toYaml .Values.resources | indent 12 }}
111 {{- if .Values.nodeSelector }}
112 nodeSelector:
113{{ toYaml .Values.nodeSelector | indent 10 }}
114 {{- end -}}
115 {{- if .Values.affinity }}
116 affinity:
117{{ toYaml .Values.affinity | indent 10 }}
118 {{- end }}
119
120 # side car containers
121 - name: {{ include "common.name" . }}-filebeat-onap
122 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
123 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
124 volumeMounts:
125 - name: {{ include "common.fullname" . }}-filebeat-conf
126 mountPath: /usr/share/filebeat/filebeat.yml
127 subPath: filebeat.yml
128 - name: {{ include "common.fullname" . }}-logs
129 mountPath: /var/log/onap
130 - name: {{ include "common.fullname" . }}-data-filebeat
131 mountPath: /usr/share/filebeat/data
132 volumes:
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000133 - name: {{ include "common.fullname" . }}-localtime
134 hostPath:
135 path: /etc/localtime
136 - name: {{ include "common.fullname" . }}-filebeat-conf
137 configMap:
138 name: {{ .Release.Name }}-sdc-filebeat-configmap
139 - name: {{ include "common.fullname" . }}-data-filebeat
140 emptyDir: {}
141 - name: {{ include "common.fullname" . }}-logback
142 configMap:
143 name : {{ include "common.fullname" . }}-logging-configmap
144 - name: {{ include "common.fullname" . }}-environments
145 configMap:
146 name: {{ .Release.Name }}-sdc-environments-configmap
147 defaultMode: 0755
148 - name: {{ include "common.fullname" . }}-logs
149 emptyDir: {}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000150 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000151 - name: "{{ include "common.namespace" . }}-docker-registry-key"