blob: 640f1ab727f697e17c3e806a0f981e2fe0e0fe97 [file] [log] [blame]
Prateekinlinux445a18e2018-08-01 06:48:33 +00001# Copyright © 2018 Amdocs, Bell Canada , ZTE
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
Grzegorz-Lis055b6ce2020-07-23 10:03:54 +020014apiVersion: apps/v1
BorislavG0433c912018-03-21 18:35:30 +020015kind: Deployment
16metadata:
17 name: {{ include "common.fullname" . }}
18 namespace: {{ include "common.namespace" . }}
19 labels:
20 app: {{ include "common.name" . }}
21 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010022 release: {{ include "common.release" . }}
BorislavG0433c912018-03-21 18:35:30 +020023 heritage: {{ .Release.Service }}
24spec:
Grzegorz-Lis055b6ce2020-07-23 10:03:54 +020025 selector:
26 matchLabels:
27 app: {{ include "common.name" . }}
BorislavG0433c912018-03-21 18:35:30 +020028 replicas: {{ .Values.replicaCount }}
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010033 release: {{ include "common.release" . }}
Huabing Zhao81b89762018-07-30 06:33:03 +000034 annotations:
35 sidecar.istio.io/inject: "{{.Values.istioSidecar}}"
BorislavG0433c912018-03-21 18:35:30 +020036 spec:
Huabing Zhao8f7cc812018-08-08 06:27:37 +000037 serviceAccountName: msb
BorislavG0433c912018-03-21 18:35:30 +020038 initContainers:
39 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020040 - /app/ready.py
BorislavG0433c912018-03-21 18:35:30 +020041 args:
42 - --container-name
43 - msb-discovery
44 env:
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020050 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
BorislavG0433c912018-03-21 18:35:30 +020051 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 name: {{ include "common.name" . }}-readiness
53 containers:
54 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000055 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
BorislavG0433c912018-03-21 18:35:30 +020056 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57 ports:
58 - containerPort: {{ .Values.service.internalPort }}
59 name: {{ .Values.service.name }}
60 - containerPort: {{ .Values.service.internalPortHttps }}
61 name: {{ .Values.service.name }}-https
62 # disable liveness probe when breakpoints set in debugger
63 # so K8s doesn't restart unresponsive container
64 {{- if eq .Values.liveness.enabled true }}
65 livenessProbe:
66 tcpSocket:
67 port: {{ .Values.service.internalPort }}
68 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
69 periodSeconds: {{ .Values.liveness.periodSeconds }}
70 {{ end -}}
71 readinessProbe:
72 tcpSocket:
73 port: {{ .Values.service.internalPort }}
74 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.readiness.periodSeconds }}
76 env:
77 - name: CONSUL_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030078 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020079 - name: SDCLIENT_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030080 value: msb-discovery.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020081 - name: ROUTE_LABELS
82 value: {{ .Values.config.routeLabels }}
83 volumeMounts:
84 - mountPath: /etc/localtime
85 name: localtime
86 readOnly: true
Huabing Zhao88cf4962020-05-14 09:17:52 +080087 - name: {{ include "common.fullname" . }}-cert
88 mountPath: /usr/local/openresty/nginx/ssl/cert/cert.crt
89 readOnly: true
90 subPath: "cert.crt"
91 - name: {{ include "common.fullname" . }}-cert
92 mountPath: /usr/local/openresty/nginx/html/cert/ca.crt
93 readOnly: true
94 subPath: "ca.crt"
LiZi4dd8e112018-04-09 07:34:04 -040095 - mountPath: /usr/local/apiroute-works/logs
Li Zic5290dc2018-08-06 09:26:27 +000096 name: {{ include "common.fullname" . }}-logs
BorislavG0433c912018-03-21 18:35:30 +020097 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000098{{ include "common.resources" . | indent 12 }}
BorislavG0433c912018-03-21 18:35:30 +020099 {{- if .Values.nodeSelector }}
100 nodeSelector:
101{{ toYaml .Values.nodeSelector | indent 10 }}
102 {{- end -}}
103 {{- if .Values.affinity }}
104 affinity:
105{{ toYaml .Values.affinity | indent 10 }}
106 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -0400107 # side car containers
108 - name: filebeat-onap
109 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
110 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
111 volumeMounts:
Li Zic5290dc2018-08-06 09:26:27 +0000112 - name: {{ include "common.fullname" . }}-filebeat-conf
113 mountPath: /usr/share/filebeat/filebeat.yml
114 subPath: filebeat.yml
115 - name: {{ include "common.fullname" . }}-data-filebeat
116 mountPath: /usr/share/filebeat/data
117 - name: {{ include "common.fullname" . }}-logs
118 mountPath: /var/log/onap/msb/msb-iag
119 - mountPath: /opt/ajsc/etc/config/logback.xml
120 name: {{ include "common.fullname" . }}-log-conf
121 subPath: logback.xml
BorislavG0433c912018-03-21 18:35:30 +0200122 volumes:
Huabing Zhao88cf4962020-05-14 09:17:52 +0800123 - name: {{ include "common.fullname" . }}-cert
124 secret:
125 secretName: {{ include "common.release" . }}-msb-https-cert
Li Zic5290dc2018-08-06 09:26:27 +0000126 - name: {{ include "common.fullname" . }}-log-conf
127 configMap:
128 name: {{ include "common.fullname" . }}-log
129 - name: {{ include "common.fullname" . }}-filebeat-conf
130 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100131 name: {{ include "common.release" . }}-msb-filebeat-configmap
Li Zic5290dc2018-08-06 09:26:27 +0000132 - name: {{ include "common.fullname" . }}-data-filebeat
133 emptyDir: {}
134 - name: {{ include "common.fullname" . }}-logs
135 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +0200136 - name: localtime
137 hostPath:
138 path: /etc/localtime
BorislavG0433c912018-03-21 18:35:30 +0200139 imagePullSecrets:
140 - name: "{{ include "common.namespace" . }}-docker-registry-key"