Merge "oom tweaks in pap configuration for pdp-x pooling"
[oom.git] / kubernetes / sdc / charts / sdc-onboarding-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" . }}-job-completion
35         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
36         imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
37         command:
38         - /root/job_complete.py
39         args:
40         - --job-name
41         - {{ .Release.Name }}-sdc-onboarding-be-cassandra-init
42         env:
43         - name: NAMESPACE
44           valueFrom:
45             fieldRef:
46               apiVersion: v1
47               fieldPath: metadata.namespace
48       containers:
49         - name: {{ include "common.name" . }}
50           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
51           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52           ports:
53           - containerPort: {{ .Values.service.internalPort }}
54           - containerPort: {{ .Values.service.internalPort2 }}
55           {{ if eq .Values.liveness.enabled true }}
56           livenessProbe:
57             tcpSocket:
58               port: {{ .Values.service.internalPort }}
59             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
60             periodSeconds: {{ .Values.liveness.periodSeconds }}
61           {{ end }}
62           readinessProbe:
63             exec:
64               command:
65               - "/var/lib/ready-probe.sh"
66             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
67             periodSeconds: {{ .Values.readiness.periodSeconds }}
68           env:
69           - name: ENVNAME
70             value: {{ .Values.global.env.name }}
71           - name: JAVA_OPTIONS
72             value: {{ .Values.config.javaOptions }}
73           - name: SDC_CLUSTER_NAME
74             value: "SDC-CS-{{ .Values.global.env.name }}"
75           - name: cassandra_ssl_enabled
76             value: {{ .Values.config.cassandraSslEnabled | quote }}
77           - name: HOST_IP
78             valueFrom:
79               fieldRef:
80                 fieldPath: status.podIP
81           - name: SDC_USER
82             valueFrom:
83               secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_user}
84           - name: SDC_PASSWORD
85             valueFrom:
86               secretKeyRef: {name: {{ .Release.Name }}-sdc-cs-secrets, key: sdc_password}
87           volumeMounts:
88           - name: {{ include "common.fullname" . }}-environments
89             mountPath: /root/chef-solo/environments/
90           - name: {{ include "common.fullname" . }}-localtime
91             mountPath: /etc/localtime
92             readOnly: true
93           - name: {{ include "common.fullname" . }}-logs
94             mountPath: /var/log/onap
95           - name: {{ include "common.fullname" . }}-logback
96             mountPath: /tmp/logback.xml
97             subPath: logback.xml
98           lifecycle:
99             postStart:
100               exec:
101                 command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/var/lib/jetty/config/onboarding-be/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"]
102           resources:
103 {{ toYaml .Values.resources | indent 12 }}
104         {{- if .Values.nodeSelector }}
105         nodeSelector:
106 {{ toYaml .Values.nodeSelector | indent 10 }}
107         {{- end -}}
108         {{- if .Values.affinity }}
109         affinity:
110 {{ toYaml .Values.affinity | indent 10 }}
111         {{- end }}
112
113         # 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:
131           name: {{ .Release.Name }}-sdc-filebeat-configmap
132       - name: {{ include "common.fullname" . }}-data-filebeat
133         emptyDir: {}
134       - name: {{ include "common.fullname" . }}-logback
135         configMap:
136           name : {{ include "common.fullname" . }}-logging-configmap
137       - name: {{ include "common.fullname" . }}-environments
138         configMap:
139           name: {{ .Release.Name }}-sdc-environments-configmap
140           defaultMode: 0755
141       - name:  {{ include "common.fullname" . }}-logs
142         emptyDir: {}
143       imagePullSecrets:
144       - name: "{{ include "common.namespace" . }}-docker-registry-key"