blob: 7ca8a8e203efc3de08e90fb76abc1d63d1bd27f8 [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-discovery
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 name: {{ .Values.service.name }}
41 - containerPort: {{ .Values.service.internalPortHttps }}
42 name: {{ .Values.service.name }}-https
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 - name: SDCLIENT_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030061 value: msb-discovery.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020062 - name: ROUTE_LABELS
63 value: {{ .Values.config.routeLabels }}
64 volumeMounts:
65 - mountPath: /etc/localtime
66 name: localtime
67 readOnly: true
LiZi4dd8e112018-04-09 07:34:04 -040068 - mountPath: /usr/local/apiroute-works/logs
69 name: msb-discovery-logs
BorislavG0433c912018-03-21 18:35:30 +020070 resources:
71{{ toYaml .Values.resources | indent 12 }}
72 {{- if .Values.nodeSelector }}
73 nodeSelector:
74{{ toYaml .Values.nodeSelector | indent 10 }}
75 {{- end -}}
76 {{- if .Values.affinity }}
77 affinity:
78{{ toYaml .Values.affinity | indent 10 }}
79 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -040080 # side car containers
81 - name: filebeat-onap
82 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
83 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
84 volumeMounts:
85 - mountPath: /var/log/onap
86 name: msb-discovery-logs
87 - mountPath: /usr/share/filebeat/data
88 name: msb-discovery-filebeat
BorislavG0433c912018-03-21 18:35:30 +020089 volumes:
90 - name: localtime
91 hostPath:
92 path: /etc/localtime
LiZi4dd8e112018-04-09 07:34:04 -040093 - name: msb-discovery-logs
94 emptyDir: {}
95 - name: msb-discovery-filebeat
96 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +020097 imagePullSecrets:
98 - name: "{{ include "common.namespace" . }}-docker-registry-key"