Merge "Align sdc configuration in oom"
[oom.git] / kubernetes / msb / charts / msb-iag / templates / deployment.yaml
1 apiVersion: extensions/v1beta1
2 kind: Deployment
3 metadata:
4   name: {{ include "common.fullname" . }}
5   namespace: {{ include "common.namespace" . }}
6   labels:
7     app: {{ include "common.name" . }}
8     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9     release: {{ .Release.Name }}
10     heritage: {{ .Release.Service }}
11 spec:
12   replicas: {{ .Values.replicaCount }}
13   template:
14     metadata:
15       labels:
16         app: {{ include "common.name" . }}
17         release: {{ .Release.Name }}
18       annotations:
19         sidecar.istio.io/inject: "{{.Values.istioSidecar}}"
20     spec:
21       initContainers:
22       - command:
23         - /root/ready.py
24         args:
25         - --container-name
26         - msb-discovery
27         env:
28         - name: NAMESPACE
29           valueFrom:
30             fieldRef:
31               apiVersion: v1
32               fieldPath: metadata.namespace
33         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
34         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
35         name: {{ include "common.name" . }}-readiness
36       containers:
37         - name: {{ include "common.name" . }}
38           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
39           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40           ports:
41           - containerPort: {{ .Values.service.internalPort }}
42             name: {{ .Values.service.name }}
43           - containerPort: {{ .Values.service.internalPortHttps }}
44             name: {{ .Values.service.name }}-https
45           # disable liveness probe when breakpoints set in debugger
46           # so K8s doesn't restart unresponsive container
47           {{- if eq .Values.liveness.enabled true }}
48           livenessProbe:
49             tcpSocket:
50               port: {{ .Values.service.internalPort }}
51             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
52             periodSeconds: {{ .Values.liveness.periodSeconds }}
53           {{ end -}}
54           readinessProbe:
55             tcpSocket:
56               port: {{ .Values.service.internalPort }}
57             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
58             periodSeconds: {{ .Values.readiness.periodSeconds }}
59           env:
60           - name: CONSUL_IP
61             value: msb-consul.{{ include "common.namespace" . }}
62           - name: SDCLIENT_IP
63             value: msb-discovery.{{ include "common.namespace" . }}
64           - name: ROUTE_LABELS
65             value: {{ .Values.config.routeLabels }}
66           volumeMounts:
67           - mountPath: /etc/localtime
68             name: localtime
69             readOnly: true
70           - mountPath: /usr/local/apiroute-works/logs
71             name: {{ include "common.fullname" . }}-logs
72           resources:
73 {{ toYaml .Values.resources | indent 12 }}
74         {{- if .Values.nodeSelector }}
75         nodeSelector:
76 {{ toYaml .Values.nodeSelector | indent 10 }}
77         {{- end -}}
78         {{- if .Values.affinity }}
79         affinity:
80 {{ toYaml .Values.affinity | indent 10 }}
81         {{- end }}
82         # side car containers
83         - name: filebeat-onap
84           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
85           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
86           volumeMounts:
87           - name: {{ include "common.fullname" . }}-filebeat-conf
88             mountPath: /usr/share/filebeat/filebeat.yml
89             subPath: filebeat.yml
90           - name: {{ include "common.fullname" . }}-data-filebeat
91             mountPath: /usr/share/filebeat/data
92           - name: {{ include "common.fullname" . }}-logs
93             mountPath: /var/log/onap/msb/msb-iag
94           - mountPath: /opt/ajsc/etc/config/logback.xml
95             name: {{ include "common.fullname" . }}-log-conf
96             subPath: logback.xml
97       volumes:
98         - name: {{ include "common.fullname" . }}-log-conf
99           configMap:
100             name: {{ include "common.fullname" . }}-log
101         - name: {{ include "common.fullname" . }}-filebeat-conf
102           configMap:
103             name: {{ .Release.Name }}-msb-filebeat-configmap
104         - name: {{ include "common.fullname" . }}-data-filebeat
105           emptyDir: {}
106         - name:  {{ include "common.fullname" . }}-logs
107           emptyDir: {}
108         - name: localtime
109           hostPath:
110             path: /etc/localtime
111       imagePullSecrets:
112       - name: "{{ include "common.namespace" . }}-docker-registry-key"