blob: 2d47f4b5881936c63acc03a5714369bc49b58d3b [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
Areli, Fuss (af732p)d6f2e9e2018-11-04 16:29:40 +020056 - {{ .Release.Name }}-sdc-onboarding-be-cassandra-init
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:
Yang Xue5d5e682019-06-19 18:20:31 -040072 httpGet:
73 path: /sdc2/rest/version
74 port: {{ .Values.service.internalPort2 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000075 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
76 periodSeconds: {{ .Values.liveness.periodSeconds }}
Yang Xu85608542019-06-16 23:25:32 -040077 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000078 {{ end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000079 readinessProbe:
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000080 exec:
81 command:
82 - "/var/lib/ready-probe.sh"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000083 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
84 periodSeconds: {{ .Values.readiness.periodSeconds }}
Yang Xu85608542019-06-16 23:25:32 -040085 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
Mukula93baa82018-09-19 15:56:58 +000086 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000087{{ include "common.resources" . | indent 12 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000088 env:
89 - name: ENVNAME
90 value: {{ .Values.global.env.name }}
91 - name: JAVA_OPTIONS
Mandeep Khinda403c1c12018-04-19 23:15:43 +000092 value: {{ .Values.config.javaOptions }}
93 - name: cassandra_ssl_enabled
94 value: {{ .Values.config.cassandraSslEnabled | quote }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000095 - name: HOST_IP
96 valueFrom:
97 fieldRef:
98 fieldPath: status.podIP
99 volumeMounts:
100 - name: {{ include "common.fullname" . }}-environments
101 mountPath: /root/chef-solo/environments/
102 - name: {{ include "common.fullname" . }}-localtime
103 mountPath: /etc/localtime
104 readOnly: true
105 - name: {{ include "common.fullname" . }}-logs
106 mountPath: /var/log/onap
107 - name: {{ include "common.fullname" . }}-logback
108 mountPath: /tmp/logback.xml
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000109 subPath: logback.xml
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000110 lifecycle:
111 postStart:
112 exec:
113 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 Khindaa1047f42018-03-22 02:12:15 +0000114 # side car containers
115 - name: {{ include "common.name" . }}-filebeat-onap
116 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
117 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
118 volumeMounts:
119 - name: {{ include "common.fullname" . }}-filebeat-conf
120 mountPath: /usr/share/filebeat/filebeat.yml
121 subPath: filebeat.yml
122 - name: {{ include "common.fullname" . }}-logs
123 mountPath: /var/log/onap
124 - name: {{ include "common.fullname" . }}-data-filebeat
125 mountPath: /usr/share/filebeat/data
126 volumes:
Mandeep Khinda403c1c12018-04-19 23:15:43 +0000127 - name: {{ include "common.fullname" . }}-localtime
128 hostPath:
129 path: /etc/localtime
130 - name: {{ include "common.fullname" . }}-filebeat-conf
131 configMap:
132 name: {{ .Release.Name }}-sdc-filebeat-configmap
133 - name: {{ include "common.fullname" . }}-data-filebeat
134 emptyDir: {}
135 - name: {{ include "common.fullname" . }}-logback
136 configMap:
137 name : {{ include "common.fullname" . }}-logging-configmap
138 - name: {{ include "common.fullname" . }}-environments
139 configMap:
140 name: {{ .Release.Name }}-sdc-environments-configmap
141 defaultMode: 0755
142 - name: {{ include "common.fullname" . }}-logs
143 emptyDir: {}
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000144 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000145 - name: "{{ include "common.namespace" . }}-docker-registry-key"