blob: 967e0e9bb7219e771ca290c3cfaeb49f6a0e7c3d [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:
21 initContainers:
22 - command:
23 - /root/ready.py
24 args:
25 - --container-name
26 - msb-consul
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" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000038 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
BorislavG0433c912018-03-21 18:35:30 +020039 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40 ports:
41 - containerPort: {{ .Values.service.internalPort }}
42 # disable liveness probe when breakpoints set in debugger
43 # so K8s doesn't restart unresponsive container
44 {{- if eq .Values.liveness.enabled true }}
45 livenessProbe:
46 tcpSocket:
47 port: {{ .Values.service.internalPort }}
48 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
49 periodSeconds: {{ .Values.liveness.periodSeconds }}
50 {{ end -}}
51 readinessProbe:
52 tcpSocket:
53 port: {{ .Values.service.internalPort }}
54 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
55 periodSeconds: {{ .Values.readiness.periodSeconds }}
56 env:
57 - name: CONSUL_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030058 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020059 volumeMounts:
60 - mountPath: /etc/localtime
61 name: localtime
62 readOnly: true
LiZi4dd8e112018-04-09 07:34:04 -040063 - mountPath: /usr/local/discover-works/logs
64 name: msb-discovery-logs
BorislavG0433c912018-03-21 18:35:30 +020065 resources:
66{{ toYaml .Values.resources | indent 12 }}
67 {{- if .Values.nodeSelector }}
68 nodeSelector:
69{{ toYaml .Values.nodeSelector | indent 10 }}
70 {{- end -}}
71 {{- if .Values.affinity }}
72 affinity:
73{{ toYaml .Values.affinity | indent 10 }}
74 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -040075
76 # side car containers
77 - name: filebeat-onap
78 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
79 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
80 volumeMounts:
81 - mountPath: /var/log/onap
82 name: msb-discovery-logs
83 - mountPath: /usr/share/filebeat/data
84 name: msb-discovery-filebeat
BorislavG0433c912018-03-21 18:35:30 +020085 volumes:
86 - name: localtime
87 hostPath:
88 path: /etc/localtime
LiZi4dd8e112018-04-09 07:34:04 -040089 - name: msb-discovery-logs
90 emptyDir: {}
91 - name: msb-discovery-filebeat
92 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +020093 imagePullSecrets:
94 - name: "{{ include "common.namespace" . }}-docker-registry-key"