blob: 4c2baaf57fb5876b2f3a902a9ded1c96169d7e45 [file] [log] [blame]
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00001# Copyright © 2017 Amdocs, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 AT&T, 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 "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000025 heritage: {{ .Release.Service }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010032 release: {{ include "common.release" . }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000033 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-kb"
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 }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000049 - 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 Opasiak137d7cc2020-01-24 23:49:11 +010056 - {{ include "common.release" . }}-sdc-be-config-backend
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000057 env:
58 - name: NAMESPACE
59 valueFrom:
60 fieldRef:
61 apiVersion: v1
62 fieldPath: metadata.namespace
Mandeep Khindaa1047f42018-03-22 02:12:15 +000063 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 Khinda403c1c12018-04-19 23:15:43 +000070 {{ if eq .Values.liveness.enabled true }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000071 livenessProbe:
72 tcpSocket:
k.kedronc784bbd2019-09-05 18:28:16 +020073 port: {{ .Values.service.internalPort2 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000074 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.liveness.periodSeconds }}
Brian Freeman6142d942019-10-02 09:50:19 -050076 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000077 {{ end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000078 readinessProbe:
79 tcpSocket:
k.kedronc784bbd2019-09-05 18:28:16 +020080 port: {{ .Values.service.internalPort2 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000081 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
82 periodSeconds: {{ .Values.readiness.periodSeconds }}
Brian Freeman6142d942019-10-02 09:50:19 -050083 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
Mukula93baa82018-09-19 15:56:58 +000084 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000085{{ include "common.resources" . | indent 12 }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000086 env:
87 - name: ENVNAME
88 value: {{ .Values.global.env.name }}
89 - name: HOST_IP
90 valueFrom:
91 fieldRef:
92 fieldPath: status.podIP
93 - name: JAVA_OPTIONS
Mandeep Khinda403c1c12018-04-19 23:15:43 +000094 value: {{ .Values.config.javaOptions }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000095 volumeMounts:
96 - name: {{ include "common.fullname" . }}-environments
97 mountPath: /root/chef-solo/environments/
98 - name: {{ include "common.fullname" . }}-localtime
99 mountPath: /etc/localtime
100 readOnly: true
101 - name: {{ include "common.fullname" . }}-logs
102 mountPath: /var/log/onap
shrikantawachar0c84bc32019-01-16 13:12:21 +0530103 - name: {{ include "common.fullname" . }}-configs
104 mountPath: /var/lib/jetty/config/catalog-fe/plugins-configuration.yaml
105 subPath: plugins-configuration.yaml
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000106 - name: {{ include "common.fullname" . }}-logback
107 mountPath: /tmp/logback.xml
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +0000108 subPath: logback.xml
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000109 lifecycle:
110 postStart:
111 exec:
112 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"]
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000113 # side car containers
114 - name: {{ include "common.name" . }}-filebeat-onap
115 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
116 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
117 volumeMounts:
118 - name: {{ include "common.fullname" . }}-filebeat-conf
119 mountPath: /usr/share/filebeat/filebeat.yml
120 subPath: filebeat.yml
121 - name: {{ include "common.fullname" . }}-logs
122 mountPath: /var/log/onap
123 - name: {{ include "common.fullname" . }}-data-filebeat
124 mountPath: /usr/share/filebeat/data
125 volumes:
126 - name: {{ include "common.fullname" . }}-localtime
127 hostPath:
128 path: /etc/localtime
129 - name: {{ include "common.fullname" . }}-filebeat-conf
130 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100131 name: {{ include "common.release" . }}-sdc-filebeat-configmap
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000132 - name: {{ include "common.fullname" . }}-data-filebeat
133 emptyDir: {}
shrikantawachar0c84bc32019-01-16 13:12:21 +0530134 - name: {{ include "common.fullname" . }}-configs
135 configMap:
136 name : {{ include "common.fullname" . }}-plugins-configmap
137 defaultMode: 0777
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000138 - name: {{ include "common.fullname" . }}-logback
139 configMap:
140 name : {{ include "common.fullname" . }}-logging-configmap
141 - name: {{ include "common.fullname" . }}-environments
142 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100143 name: {{ include "common.release" . }}-sdc-environments-configmap
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000144 defaultMode: 0755
145 - name: {{ include "common.fullname" . }}-logs
146 emptyDir: {}
147 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000148 - name: "{{ include "common.namespace" . }}-docker-registry-key"