[SO] 16.0.4 release
[oom.git] / kubernetes / portal-ng / components / portal-ng-ui / templates / deployment.yaml
1 {{/*
2 # Copyright © 2022 Deutsche Telekom
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 */}}
16 ---
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   selector: {{- include "common.selectors" . | nindent 4 }}
22   replicas: {{ .Values.replicaCount }}
23   revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
24   template:
25     metadata:
26       annotations:
27         checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
28       {{- include "common.templateMetadata" . | indent 6 }}
29     spec:
30       {{- include "common.imagePullSecrets" . | nindent 6 }}
31       {{ include "common.podSecurityContext" . | indent 6 | trim }}
32       containers:
33         - name: {{ .Chart.Name }}
34           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image.imageName }}:{{ .Values.image.tag | default .Chart.AppVersion }}
35           imagePullPolicy: {{ .Values.image.pullPolicy }}
36           {{ include "common.containerSecurityContext" . | indent 10 | trim }}
37           envFrom:
38           - configMapRef:
39               name: {{ include "common.fullname" . }}-configmap
40           ports: {{ include "common.containerPorts" . | nindent 12  }}
41           livenessProbe:
42             httpGet:
43               path: /
44               port: {{ .Values.service.internalPort}}
45             initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
46             failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
47           readinessProbe:
48             httpGet:
49               path: /
50               port: {{ .Values.service.internalPort}}
51             initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
52             failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
53           volumeMounts:
54           - name: tiles-icons
55             mountPath: {{ .Values.nginx.tilesIconsPath }}
56             readOnly: true
57           - name: tiles-json
58             mountPath: {{ .Values.nginx.tilesPath }}
59             subPath: tiles.json
60             readOnly: true
61           - name: nginx-config
62             mountPath: /etc/nginx/conf.d/default.conf
63             subPath: default.conf
64             readOnly: true
65           - name: assets
66             mountPath: /usr/share/nginx/html/assets/env.js
67             subPath: env.js
68             readOnly: true
69           - name: assets
70             mountPath: /usr/share/nginx/html/assets/acl.json
71             subPath: acl.json
72             readOnly: true
73           - name: assets
74             mountPath: /usr/share/nginx/html/assets/version.json
75             subPath: version.json
76             readOnly: true
77           - name: tmp-volume
78             mountPath: /tmp
79           - name: nginx-cache-volume
80             mountPath: /var/cache/nginx
81           resources: {{ include "common.resources" . | nindent 12 }}
82         {{- with .Values.nodeSelector }}
83         nodeSelector:
84           {{- toYaml . | nindent 10 }}
85         {{- end }}
86         {{- with .Values.affinity }}
87         affinity:
88           {{- toYaml . | nindent 10 }}
89         {{- end }}
90         {{- with .Values.tolerations }}
91         tolerations:
92           {{- toYaml . | nindent 10 }}
93         {{- end }}
94       volumes:
95         - name: tiles-icons
96           configMap:
97             name: {{ include "common.fullname" . }}-tiles-icons
98         - name: tiles-json
99           configMap:
100             name: {{ include "common.fullname" . }}-tiles-json
101             items:
102             - key: tiles.json
103               path: tiles.json
104         - name: nginx-config
105           configMap:
106             name: {{ include "common.fullname" . }}-nginx-config
107         - name: assets
108           configMap:
109             name: {{ include "common.fullname" . }}-assets
110             items:
111               - key: env_js
112                 path: env.js
113               - key: acl_json
114                 path: acl.json
115               - key: version_json
116                 path: version.json
117         - name: tmp-volume
118           emptyDir:
119             sizeLimit: 64Mi
120         - name: nginx-cache-volume
121           emptyDir:
122             sizeLimit: 64Mi