blob: 31bb2c96c8e942af9cfe95b15869650d1fa35f7d [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-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" . }}
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 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
BorislavG6c7ecf02018-04-01 13:08:37 +030061 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020062 - name: SDCLIENT_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030063 value: msb-discovery.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020064 - name: ROUTE_LABELS
65 value: {{ .Values.config.routeLabels }}
66 volumeMounts:
67 - mountPath: /etc/localtime
68 name: localtime
69 readOnly: true
LiZi4dd8e112018-04-09 07:34:04 -040070 - mountPath: /usr/local/apiroute-works/logs
71 name: msb-discovery-logs
BorislavG0433c912018-03-21 18:35:30 +020072 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 }}
LiZi4dd8e112018-04-09 07:34:04 -040082 # 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 - mountPath: /var/log/onap
88 name: msb-discovery-logs
89 - mountPath: /usr/share/filebeat/data
90 name: msb-discovery-filebeat
BorislavG0433c912018-03-21 18:35:30 +020091 volumes:
92 - name: localtime
93 hostPath:
94 path: /etc/localtime
LiZi4dd8e112018-04-09 07:34:04 -040095 - name: msb-discovery-logs
96 emptyDir: {}
97 - name: msb-discovery-filebeat
98 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +020099 imagePullSecrets:
100 - name: "{{ include "common.namespace" . }}-docker-registry-key"