blob: 3c3f60efa4b665fe604844146ededcae3961f097 [file] [log] [blame]
xudan16c7f36a62022-07-21 17:27:14 +08001{{/*
2# Copyright © 2022 Huawei Technologies Co., Ltd. All rights reserved.
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.
14*/}}
15
16apiVersion: apps/v1
17kind: Deployment
18metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
19spec:
20 selector: {{- include "common.selectors" . | nindent 4 }}
21 replicas: {{ .Values.replicaCount }}
22 template:
23 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
24 spec:
25 initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }}
26 containers:
27 - name: {{ include "common.name" . }}
28 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
29 imagePullPolicy: {{ .Values.pullPolicy }}
30 command: ["sh", "-c"]
31 args:
32 - ". /uui/run.sh"
33 ports: {{ include "common.containerPorts" . | nindent 10 }}
34 env:
35 - name: POSTGRES_IP
36 value: {{ .Values.postgres.service.name2 }}
37 - name: POSTGRES_PORT
38 value: "{{ .Values.postgres.service.externalPort }}"
39 - name: POSTGRES_DB_NAME
40 value: {{ .Values.postgres.config.pgDatabase }}
41 - name: POSTGRES_USERNAME
42 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
43 - name: POSTGRES_PASSWORD
44 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
45{{- if eq .Values.liveness.enabled true }}
46 livenessProbe:
47 tcpSocket:
48 port: {{ .Values.liveness.port }}
49 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
50 periodSeconds: {{ .Values.liveness.periodSeconds }}
51{{- end }}
52 readinessProbe:
53 tcpSocket:
54 port: {{ .Values.readiness.port }}
55 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
56 periodSeconds: {{ .Values.readiness.periodSeconds }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010057 resources: {{ include "common.resources" . | nindent 10 }}
xudan16c7f36a62022-07-21 17:27:14 +080058{{- if .Values.nodeSelector }}
59 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
60{{- end }}
61{{- if .Values.affinity }}
62 affinity: {{ toYaml .Values.affinity | nindent 10 }}
63{{- end }}
64 volumeMounts:
65 - mountPath: /uui/run.sh
66 name: entrypoint
67 subPath: run.sh
68 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
69 volumes:
70 - name: entrypoint
71 configMap:
72 name: {{ include "common.fullname" . }}-entrypoint
73 defaultMode: 0755
74 imagePullSecrets:
75 - name: "{{ include "common.namespace" . }}-docker-registry-key"