Adding sdc-onboarding-be to OOM
[oom.git] / kubernetes / sdc / charts / sdc-fe / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, 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-kb"
40         - --container-name
41         - "sdc-be"
42         - --container-name
43         - "sdc-onboarding-be"
44         env:
45         - name: NAMESPACE
46           valueFrom:
47             fieldRef:
48               apiVersion: v1
49               fieldPath: metadata.namespace
50         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
51         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52       - name: {{ include "common.name" . }}-job-completion
53         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
54         imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
55         command:
56         - /root/job_complete.py
57         args:
58         - --job-name
59         - {{ .Release.Name }}-sdc-be-config-backend
60         env:
61         - name: NAMESPACE
62           valueFrom:
63             fieldRef:
64               apiVersion: v1
65               fieldPath: metadata.namespace
66       containers:
67         - name: {{ include "common.name" . }}
68           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
69           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
70           ports:
71           - containerPort: {{ .Values.service.internalPort }}
72           - containerPort: {{ .Values.service.internalPort2 }}
73           {{ if eq .Values.liveness.enabled true }}
74           livenessProbe:
75             tcpSocket:
76               port: {{ .Values.service.internalPort }}
77             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
78             periodSeconds: {{ .Values.liveness.periodSeconds }}
79           {{ end }}
80           readinessProbe:
81             tcpSocket:
82               port: {{ .Values.service.internalPort }}
83             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
84             periodSeconds: {{ .Values.readiness.periodSeconds }}
85           env:
86           - name: ENVNAME
87             value: {{ .Values.global.env.name }}
88           - name: HOST_IP
89             valueFrom:
90               fieldRef:
91                 fieldPath: status.podIP
92           - name: JAVA_OPTIONS
93             value: {{ .Values.config.javaOptions }}
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
104             subPath: logback.xml
105           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-fe/; 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:
133         - 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: {}
150       imagePullSecrets:
151       - name: "{{ include "common.namespace" . }}-docker-registry-key"