blob: f95f1059a62c6252f285e38112159b0d1d8b2fa5 [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.
BorislavG0433c912018-03-21 18:35:30 +020014apiVersion: extensions/v1beta1
15kind: 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:
25 replicas: {{ .Values.replicaCount }}
26 template:
27 metadata:
28 labels:
29 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010030 release: {{ include "common.release" . }}
Huabing Zhao81b89762018-07-30 06:33:03 +000031 annotations:
32 sidecar.istio.io/inject: "{{.Values.istioSidecar}}"
BorislavG0433c912018-03-21 18:35:30 +020033 spec:
Huabing Zhao8f7cc812018-08-08 06:27:37 +000034 serviceAccountName: msb
BorislavG0433c912018-03-21 18:35:30 +020035 initContainers:
36 - command:
37 - /root/ready.py
38 args:
39 - --container-name
40 - msb-discovery
41 env:
42 - name: NAMESPACE
43 valueFrom:
44 fieldRef:
45 apiVersion: v1
46 fieldPath: metadata.namespace
47 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
48 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
49 name: {{ include "common.name" . }}-readiness
50 containers:
51 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000052 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
BorislavG0433c912018-03-21 18:35:30 +020053 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 ports:
55 - containerPort: {{ .Values.service.internalPort }}
56 name: {{ .Values.service.name }}
57 - containerPort: {{ .Values.service.internalPortHttps }}
58 name: {{ .Values.service.name }}-https
59 # disable liveness probe when breakpoints set in debugger
60 # so K8s doesn't restart unresponsive container
61 {{- if eq .Values.liveness.enabled true }}
62 livenessProbe:
63 tcpSocket:
64 port: {{ .Values.service.internalPort }}
65 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
66 periodSeconds: {{ .Values.liveness.periodSeconds }}
67 {{ end -}}
68 readinessProbe:
69 tcpSocket:
70 port: {{ .Values.service.internalPort }}
71 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
72 periodSeconds: {{ .Values.readiness.periodSeconds }}
73 env:
74 - name: CONSUL_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030075 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020076 - name: SDCLIENT_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030077 value: msb-discovery.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020078 - name: ROUTE_LABELS
79 value: {{ .Values.config.routeLabels }}
80 volumeMounts:
81 - mountPath: /etc/localtime
82 name: localtime
83 readOnly: true
Huabing Zhao88cf4962020-05-14 09:17:52 +080084 - name: {{ include "common.fullname" . }}-cert
85 mountPath: /usr/local/openresty/nginx/ssl/cert/cert.crt
86 readOnly: true
87 subPath: "cert.crt"
88 - name: {{ include "common.fullname" . }}-cert
89 mountPath: /usr/local/openresty/nginx/html/cert/ca.crt
90 readOnly: true
91 subPath: "ca.crt"
LiZi4dd8e112018-04-09 07:34:04 -040092 - mountPath: /usr/local/apiroute-works/logs
Li Zic5290dc2018-08-06 09:26:27 +000093 name: {{ include "common.fullname" . }}-logs
BorislavG0433c912018-03-21 18:35:30 +020094 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000095{{ include "common.resources" . | indent 12 }}
BorislavG0433c912018-03-21 18:35:30 +020096 {{- if .Values.nodeSelector }}
97 nodeSelector:
98{{ toYaml .Values.nodeSelector | indent 10 }}
99 {{- end -}}
100 {{- if .Values.affinity }}
101 affinity:
102{{ toYaml .Values.affinity | indent 10 }}
103 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -0400104 # side car containers
105 - name: filebeat-onap
106 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
107 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
108 volumeMounts:
Li Zic5290dc2018-08-06 09:26:27 +0000109 - name: {{ include "common.fullname" . }}-filebeat-conf
110 mountPath: /usr/share/filebeat/filebeat.yml
111 subPath: filebeat.yml
112 - name: {{ include "common.fullname" . }}-data-filebeat
113 mountPath: /usr/share/filebeat/data
114 - name: {{ include "common.fullname" . }}-logs
115 mountPath: /var/log/onap/msb/msb-iag
116 - mountPath: /opt/ajsc/etc/config/logback.xml
117 name: {{ include "common.fullname" . }}-log-conf
118 subPath: logback.xml
BorislavG0433c912018-03-21 18:35:30 +0200119 volumes:
Huabing Zhao88cf4962020-05-14 09:17:52 +0800120 - name: {{ include "common.fullname" . }}-cert
121 secret:
122 secretName: {{ include "common.release" . }}-msb-https-cert
Li Zic5290dc2018-08-06 09:26:27 +0000123 - name: {{ include "common.fullname" . }}-log-conf
124 configMap:
125 name: {{ include "common.fullname" . }}-log
126 - name: {{ include "common.fullname" . }}-filebeat-conf
127 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100128 name: {{ include "common.release" . }}-msb-filebeat-configmap
Li Zic5290dc2018-08-06 09:26:27 +0000129 - name: {{ include "common.fullname" . }}-data-filebeat
130 emptyDir: {}
131 - name: {{ include "common.fullname" . }}-logs
132 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +0200133 - name: localtime
134 hostPath:
135 path: /etc/localtime
BorislavG0433c912018-03-21 18:35:30 +0200136 imagePullSecrets:
137 - name: "{{ include "common.namespace" . }}-docker-registry-key"