blob: ad4780966e7892dd39aa1849d4abd8b5a4a8ac49 [file] [log] [blame]
BorislavG0433c912018-03-21 18:35:30 +02001apiVersion: extensions/v1beta1
2kind: Deployment
3metadata:
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 }}
11spec:
12 replicas: {{ .Values.replicaCount }}
13 template:
14 metadata:
15 labels:
16 app: {{ include "common.name" . }}
17 release: {{ .Release.Name }}
Huabing Zhao81b89762018-07-30 06:33:03 +000018 annotations:
19 sidecar.istio.io/inject: "{{.Values.istioSidecar}}"
BorislavG0433c912018-03-21 18:35:30 +020020 spec:
Huabing Zhao8f7cc812018-08-08 06:27:37 +000021 serviceAccountName: msb
BorislavG0433c912018-03-21 18:35:30 +020022 initContainers:
23 - command:
24 - /root/ready.py
25 args:
26 - --container-name
27 - msb-consul
28 env:
29 - name: NAMESPACE
30 valueFrom:
31 fieldRef:
32 apiVersion: v1
33 fieldPath: metadata.namespace
34 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
35 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
36 name: {{ include "common.name" . }}-readiness
37 containers:
38 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000039 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
BorislavG0433c912018-03-21 18:35:30 +020040 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41 ports:
42 - containerPort: {{ .Values.service.internalPort }}
43 # disable liveness probe when breakpoints set in debugger
44 # so K8s doesn't restart unresponsive container
45 {{- if eq .Values.liveness.enabled true }}
46 livenessProbe:
47 tcpSocket:
48 port: {{ .Values.service.internalPort }}
49 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
50 periodSeconds: {{ .Values.liveness.periodSeconds }}
51 {{ end -}}
52 readinessProbe:
53 tcpSocket:
54 port: {{ .Values.service.internalPort }}
55 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
56 periodSeconds: {{ .Values.readiness.periodSeconds }}
57 env:
58 - name: CONSUL_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030059 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020060 volumeMounts:
61 - mountPath: /etc/localtime
62 name: localtime
63 readOnly: true
LiZi4dd8e112018-04-09 07:34:04 -040064 - mountPath: /usr/local/discover-works/logs
Li Zic5290dc2018-08-06 09:26:27 +000065 name: {{ include "common.fullname" . }}-logs
BorislavG0433c912018-03-21 18:35:30 +020066 resources:
67{{ toYaml .Values.resources | indent 12 }}
68 {{- if .Values.nodeSelector }}
69 nodeSelector:
70{{ toYaml .Values.nodeSelector | indent 10 }}
71 {{- end -}}
72 {{- if .Values.affinity }}
73 affinity:
74{{ toYaml .Values.affinity | indent 10 }}
75 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -040076
Li Zic5290dc2018-08-06 09:26:27 +000077 # Filebeat sidecar container
78 - name: {{ include "common.name" . }}-filebeat-onap
LiZi4dd8e112018-04-09 07:34:04 -040079 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
80 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 volumeMounts:
Li Zic5290dc2018-08-06 09:26:27 +000082 - name: {{ include "common.fullname" . }}-filebeat-conf
83 mountPath: /usr/share/filebeat/filebeat.yml
84 subPath: filebeat.yml
85 - name: {{ include "common.fullname" . }}-data-filebeat
86 mountPath: /usr/share/filebeat/data
87 - name: {{ include "common.fullname" . }}-logs
88 mountPath: /var/log/onap/msb/msb-discovery
89 - mountPath: /opt/ajsc/etc/config/logback.xml
90 name: {{ include "common.fullname" . }}-log-conf
91 subPath: logback.xml
BorislavG0433c912018-03-21 18:35:30 +020092 volumes:
Li Zic5290dc2018-08-06 09:26:27 +000093 - name: {{ include "common.fullname" . }}-log-conf
94 configMap:
95 name: {{ include "common.fullname" . }}-log
96 - name: {{ include "common.fullname" . }}-filebeat-conf
97 configMap:
98 name: {{ .Release.Name }}-msb-filebeat-configmap
99 - name: {{ include "common.fullname" . }}-data-filebeat
100 emptyDir: {}
101 - name: {{ include "common.fullname" . }}-logs
102 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +0200103 - name: localtime
104 hostPath:
105 path: /etc/localtime
BorislavG0433c912018-03-21 18:35:30 +0200106 imagePullSecrets:
107 - name: "{{ include "common.namespace" . }}-docker-registry-key"