Adding sdc-onboarding-be to OOM
[oom.git] / kubernetes / sdc / charts / sdc-be / templates / deployment.yaml
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
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
39         - "sdc-es"
40         - --container-name
41         - "sdc-cs"
42         - --container-name
43         - "sdc-kb"
44         - --container-name
45         - "sdc-onboarding-be"
46         env:
47         - name: NAMESPACE
48           valueFrom:
49             fieldRef:
50               apiVersion: v1
51               fieldPath: metadata.namespace
52         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
53         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54       - name: {{ include "common.name" . }}-job-completion
55         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
56         imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
57         command:
58         - /root/job_complete.py
59         args:
60         - --job-name
61         - {{ .Release.Name }}-sdc-cs-config-cassandra
62         env:
63         - name: NAMESPACE
64           valueFrom:
65             fieldRef:
66               apiVersion: v1
67               fieldPath: metadata.namespace
68       containers:
69         - name: {{ include "common.name" . }}
70           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
71           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72           ports:
73           - containerPort: {{ .Values.service.internalPort }}
74           - containerPort: {{ .Values.service.internalPort2 }}
75           {{ if eq .Values.liveness.enabled true }}
76           livenessProbe:
77             tcpSocket:
78               port: {{ .Values.service.internalPort }}
79             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
80             periodSeconds: {{ .Values.liveness.periodSeconds }}
81           {{ end }}
82           readinessProbe:
83             exec:
84               command:
85               - "/var/lib/ready-probe.sh"
86             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
87             periodSeconds: {{ .Values.readiness.periodSeconds }}
88           env:
89           - name: ENVNAME
90             value: {{ .Values.global.env.name }}
91           - name: JAVA_OPTIONS
92             value: {{ .Values.config.javaOptions }}
93           - name: cassandra_ssl_enabled
94             value: {{ .Values.config.cassandraSslEnabled | quote }}
95           - 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
109             subPath: logback.xml
110           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"]
114           resources:
115 {{ toYaml .Values.resources | indent 12 }}
116         {{- if .Values.nodeSelector }}
117         nodeSelector:
118 {{ toYaml .Values.nodeSelector | indent 10 }}
119         {{- end -}}
120         {{- if .Values.affinity }}
121         affinity:
122 {{ toYaml .Values.affinity | indent 10 }}
123         {{- end }}
124
125         # side car containers
126         - name: {{ include "common.name" . }}-filebeat-onap
127           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
128           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
129           volumeMounts:
130           - name: {{ include "common.fullname" . }}-filebeat-conf
131             mountPath: /usr/share/filebeat/filebeat.yml
132             subPath: filebeat.yml
133           - name: {{ include "common.fullname" . }}-logs
134             mountPath: /var/log/onap
135           - name: {{ include "common.fullname" . }}-data-filebeat
136             mountPath: /usr/share/filebeat/data
137       volumes:
138       - name: {{ include "common.fullname" . }}-localtime
139         hostPath:
140           path: /etc/localtime
141       - name: {{ include "common.fullname" . }}-filebeat-conf
142         configMap:
143           name: {{ .Release.Name }}-sdc-filebeat-configmap
144       - name: {{ include "common.fullname" . }}-data-filebeat
145         emptyDir: {}
146       - name: {{ include "common.fullname" . }}-logback
147         configMap:
148           name : {{ include "common.fullname" . }}-logging-configmap
149       - name: {{ include "common.fullname" . }}-environments
150         configMap:
151           name: {{ .Release.Name }}-sdc-environments-configmap
152           defaultMode: 0755
153       - name:  {{ include "common.fullname" . }}-logs
154         emptyDir: {}
155       imagePullSecrets:
156       - name: "{{ include "common.namespace" . }}-docker-registry-key"