blob: db24152026dc1766de6ae7378851e5522d592b5b [file] [log] [blame]
Jakub Latusekbe896842020-10-21 13:36:29 +02001{{/*
Prateekinlinux445a18e2018-08-01 06:48:33 +00002# Copyright © 2018 Amdocs, Bell Canada , ZTE
Sylvain Desbureaux55af6482020-11-02 18:21:11 +01003# Copyright © 2021 Orange
Prateekinlinux445a18e2018-08-01 06:48:33 +00004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Jakub Latusekbe896842020-10-21 13:36:29 +020016*/}}
Grzegorz-Lis055b6ce2020-07-23 10:03:54 +020017apiVersion: apps/v1
BorislavG0433c912018-03-21 18:35:30 +020018kind: Deployment
19metadata:
20 name: {{ include "common.fullname" . }}
21 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
BorislavG0433c912018-03-21 18:35:30 +020026 heritage: {{ .Release.Service }}
27spec:
Grzegorz-Lis055b6ce2020-07-23 10:03:54 +020028 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
BorislavG0433c912018-03-21 18:35:30 +020031 replicas: {{ .Values.replicaCount }}
32 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
Huabing Zhao81b89762018-07-30 06:33:03 +000037 annotations:
38 sidecar.istio.io/inject: "{{.Values.istioSidecar}}"
BorislavG0433c912018-03-21 18:35:30 +020039 spec:
40 initContainers:
Sylvain Desbureaux55af6482020-11-02 18:21:11 +010041 {{ include "common.certInitializer.initContainer" . | indent 6 | trim }}
BorislavG0433c912018-03-21 18:35:30 +020042 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020043 - /app/ready.py
BorislavG0433c912018-03-21 18:35:30 +020044 args:
45 - --container-name
46 - msb-discovery
47 env:
48 - name: NAMESPACE
49 valueFrom:
50 fieldRef:
51 apiVersion: v1
52 fieldPath: metadata.namespace
Sylvain Desbureauxfd2f8b82020-11-21 22:50:06 +010053 image: {{ include "repositoryGenerator.image.readiness" . }}
BorislavG0433c912018-03-21 18:35:30 +020054 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55 name: {{ include "common.name" . }}-readiness
56 containers:
57 - name: {{ include "common.name" . }}
Sylvain Desbureauxfd2f8b82020-11-21 22:50:06 +010058 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
BorislavG0433c912018-03-21 18:35:30 +020059 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 ports:
61 - containerPort: {{ .Values.service.internalPort }}
62 name: {{ .Values.service.name }}
63 - containerPort: {{ .Values.service.internalPortHttps }}
64 name: {{ .Values.service.name }}-https
65 # disable liveness probe when breakpoints set in debugger
66 # so K8s doesn't restart unresponsive container
67 {{- if eq .Values.liveness.enabled true }}
68 livenessProbe:
69 tcpSocket:
70 port: {{ .Values.service.internalPort }}
71 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
72 periodSeconds: {{ .Values.liveness.periodSeconds }}
73 {{ end -}}
74 readinessProbe:
75 tcpSocket:
76 port: {{ .Values.service.internalPort }}
77 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
78 periodSeconds: {{ .Values.readiness.periodSeconds }}
79 env:
80 - name: CONSUL_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030081 value: msb-consul.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020082 - name: SDCLIENT_IP
BorislavG6c7ecf02018-04-01 13:08:37 +030083 value: msb-discovery.{{ include "common.namespace" . }}
BorislavG0433c912018-03-21 18:35:30 +020084 - name: ROUTE_LABELS
85 value: {{ .Values.config.routeLabels }}
86 volumeMounts:
Sylvain Desbureaux55af6482020-11-02 18:21:11 +010087 {{ include "common.certInitializer.volumeMount" . | indent 10 | trim }}
BorislavG0433c912018-03-21 18:35:30 +020088 - mountPath: /etc/localtime
89 name: localtime
90 readOnly: true
LiZi4dd8e112018-04-09 07:34:04 -040091 - mountPath: /usr/local/apiroute-works/logs
Li Zic5290dc2018-08-06 09:26:27 +000092 name: {{ include "common.fullname" . }}-logs
Sylvain Desbureaux55af6482020-11-02 18:21:11 +010093 - mountPath: /usr/local/openresty/nginx/msb-enabled/msbhttps.conf
94 name: {{ include "common.fullname" . }}-nginx-conf
95 subPath: msbhttps.conf
BorislavG0433c912018-03-21 18:35:30 +020096 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000097{{ include "common.resources" . | indent 12 }}
BorislavG0433c912018-03-21 18:35:30 +020098 {{- if .Values.nodeSelector }}
99 nodeSelector:
100{{ toYaml .Values.nodeSelector | indent 10 }}
101 {{- end -}}
102 {{- if .Values.affinity }}
103 affinity:
104{{ toYaml .Values.affinity | indent 10 }}
105 {{- end }}
LiZi4dd8e112018-04-09 07:34:04 -0400106 # side car containers
Maciej Wereski0763e6e2021-11-18 11:48:25 +0100107 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmya4478e82021-10-11 13:48:11 +0200108 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
BorislavG0433c912018-03-21 18:35:30 +0200109 volumes:
Sylvain Desbureaux55af6482020-11-02 18:21:11 +0100110 {{ include "common.certInitializer.volumes" . | indent 8 | trim }}
Li Zic5290dc2018-08-06 09:26:27 +0000111 - name: {{ include "common.fullname" . }}-log-conf
112 configMap:
113 name: {{ include "common.fullname" . }}-log
Sylvain Desbureaux55af6482020-11-02 18:21:11 +0100114 - name: {{ include "common.fullname" . }}-nginx-conf
115 configMap:
116 name: {{ include "common.fullname" . }}-nginx
Maciej Wereski0763e6e2021-11-18 11:48:25 +0100117 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
Li Zic5290dc2018-08-06 09:26:27 +0000118 - name: {{ include "common.fullname" . }}-logs
119 emptyDir: {}
BorislavG0433c912018-03-21 18:35:30 +0200120 - name: localtime
121 hostPath:
122 path: /etc/localtime
BorislavG0433c912018-03-21 18:35:30 +0200123 imagePullSecrets:
124 - name: "{{ include "common.namespace" . }}-docker-registry-key"