blob: 235fabc9ce1a40b6660bd02bef828afafbc7905d [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-discovery
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 name: {{ .Values.service.name }}
44 - containerPort: {{ .Values.service.internalPortHttps }}
45 name: {{ .Values.service.name }}-https
46 # disable liveness probe when breakpoints set in debugger
47 # so K8s doesn't restart unresponsive container
48 {{- if eq .Values.liveness.enabled true }}
49 livenessProbe:
50 tcpSocket:
51 port: {{ .Values.service.internalPort }}
52 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
53 periodSeconds: {{ .Values.liveness.periodSeconds }}
54 {{ end -}}
55 readinessProbe:
56 tcpSocket:
57 port: {{ .Values.service.internalPort }}
58 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
59 periodSeconds: {{ .Values.readiness.periodSeconds }}
60 env:
61 - name: CONSUL_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030062 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020063 - name: SDCLIENT_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030064 value: msb-discovery.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020065 - name: ROUTE_LABELS
66 value: {{ .Values.config.routeLabels }}
67 volumeMounts:
68 - mountPath: /etc/localtime
69 name: localtime
70 readOnly: true
LiZi4dd8e112018-04-09 07:34:04 -040071 - mountPath: /usr/local/apiroute-works/logs
Li Zic5290dc2018-08-06 09:26:27 +000072 name: {{ include "common.fullname" . }}-logs
BorislavG0433c912018-03-21 18:35:30 +020073 resources:
74{{ toYaml .Values.resources | indent 12 }}
75 {{- if .Values.nodeSelector }}
76 nodeSelector:
77{{ toYaml .Values.nodeSelector | indent 10 }}
78 {{- end -}}
79 {{- if .Values.affinity }}
80 affinity:
81{{ toYaml .Values.affinity | indent 10 }}
82 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -040083 # side car containers
84 - name: filebeat-onap
85 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
86 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
87 volumeMounts:
Li Zic5290dc2018-08-06 09:26:27 +000088 - name: {{ include "common.fullname" . }}-filebeat-conf
89 mountPath: /usr/share/filebeat/filebeat.yml
90 subPath: filebeat.yml
91 - name: {{ include "common.fullname" . }}-data-filebeat
92 mountPath: /usr/share/filebeat/data
93 - name: {{ include "common.fullname" . }}-logs
94 mountPath: /var/log/onap/msb/msb-iag
95 - mountPath: /opt/ajsc/etc/config/logback.xml
96 name: {{ include "common.fullname" . }}-log-conf
97 subPath: logback.xml
BorislavG0433c912018-03-21 18:35:30 +020098 volumes:
Li Zic5290dc2018-08-06 09:26:27 +000099 - name: {{ include "common.fullname" . }}-log-conf
100 configMap:
101 name: {{ include "common.fullname" . }}-log
102 - name: {{ include "common.fullname" . }}-filebeat-conf
103 configMap:
104 name: {{ .Release.Name }}-msb-filebeat-configmap
105 - name: {{ include "common.fullname" . }}-data-filebeat
106 emptyDir: {}
107 - name: {{ include "common.fullname" . }}-logs
108 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +0200109 - name: localtime
110 hostPath:
111 path: /etc/localtime
BorislavG0433c912018-03-21 18:35:30 +0200112 imagePullSecrets:
113 - name: "{{ include "common.namespace" . }}-docker-registry-key"