blob: b2660052ddea23529ad9e1e945a3527da2001561 [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 }}
18 spec:
19 initContainers:
20 - command:
21 - /root/ready.py
22 args:
23 - --container-name
24 - msb-consul
25 env:
26 - name: NAMESPACE
27 valueFrom:
28 fieldRef:
29 apiVersion: v1
30 fieldPath: metadata.namespace
31 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
32 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
33 name: {{ include "common.name" . }}-readiness
34 containers:
35 - name: {{ include "common.name" . }}
36 image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}"
37 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38 ports:
39 - containerPort: {{ .Values.service.internalPort }}
40 # disable liveness probe when breakpoints set in debugger
41 # so K8s doesn't restart unresponsive container
42 {{- if eq .Values.liveness.enabled true }}
43 livenessProbe:
44 tcpSocket:
45 port: {{ .Values.service.internalPort }}
46 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
47 periodSeconds: {{ .Values.liveness.periodSeconds }}
48 {{ end -}}
49 readinessProbe:
50 tcpSocket:
51 port: {{ .Values.service.internalPort }}
52 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
53 periodSeconds: {{ .Values.readiness.periodSeconds }}
54 env:
55 - name: CONSUL_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030056 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020057 volumeMounts:
58 - mountPath: /etc/localtime
59 name: localtime
60 readOnly: true
LiZi4dd8e112018-04-09 07:34:04 -040061 - mountPath: /usr/local/discover-works/logs
62 name: msb-discovery-logs
BorislavG0433c912018-03-21 18:35:30 +020063 resources:
64{{ toYaml .Values.resources | indent 12 }}
65 {{- if .Values.nodeSelector }}
66 nodeSelector:
67{{ toYaml .Values.nodeSelector | indent 10 }}
68 {{- end -}}
69 {{- if .Values.affinity }}
70 affinity:
71{{ toYaml .Values.affinity | indent 10 }}
72 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -040073
74 # side car containers
75 - name: filebeat-onap
76 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 volumeMounts:
79 - mountPath: /var/log/onap
80 name: msb-discovery-logs
81 - mountPath: /usr/share/filebeat/data
82 name: msb-discovery-filebeat
BorislavG0433c912018-03-21 18:35:30 +020083 volumes:
84 - name: localtime
85 hostPath:
86 path: /etc/localtime
LiZi4dd8e112018-04-09 07:34:04 -040087 - name: msb-discovery-logs
88 emptyDir: {}
89 - name: msb-discovery-filebeat
90 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +020091 imagePullSecrets:
92 - name: "{{ include "common.namespace" . }}-docker-registry-key"