blob: 49185589b0e31ba08c2e778a54fec7e2ea6e970e [file] [log] [blame]
gioc9161872024-04-21 10:46:35 +04001---
2apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
3kind: Deployment
4metadata:
5 name: {{ include "common.names.fullname" . }}-web
6 labels:
7 {{- include "common.labels.standard" . | nindent 4 }}
8 openproject/process: web
9spec:
10 replicas: {{ .Values.replicaCount }}
11 strategy:
12 type: {{ .Values.strategy.type }}
13 selector:
14 matchLabels:
15 {{- include "common.labels.matchLabels" . | nindent 6 }}
16 openproject/process: web
17 template:
18 metadata:
19 annotations:
20 {{- range $key, $val := .Values.podAnnotations }}
21 {{ $key }}: {{ $val | quote }}
22 {{- end }}
23 {{- include "openproject.envChecksums" . | nindent 8 }}
24 labels:
25 {{- include "common.labels.standard" . | nindent 8 }}
26 openproject/process: web
27 spec:
28 {{- include "openproject.imagePullSecrets" . | indent 6 }}
29 {{- with .Values.affinity }}
30 affinity:
31 {{ toYaml . | nindent 8 | trim }}
32 {{- end }}
33 {{- with .Values.tolerations }}
34 tolerations:
35 {{ toYaml . | nindent 8 | trim }}
36 {{- end }}
37 {{- with .Values.nodeSelector }}
38 nodeSelector:
39 {{ toYaml . | nindent 8 | trim }}
40 {{- end }}
41 {{- include "openproject.podSecurityContext" . | indent 6 }}
42 serviceAccountName: {{ include "common.names.fullname" . }}
43 volumes:
44 {{- include "openproject.tmpVolumeSpec" . | indent 8 }}
45 {{- if .Values.egress.tls.rootCA.fileName }}
46 - name: ca-pemstore
47 configMap:
48 name: "{{- .Values.egress.tls.rootCA.configMap }}"
49 {{- end }}
50 {{- if .Values.persistence.enabled }}
51 - name: "data"
52 persistentVolumeClaim:
53 claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "common.names.fullname" . }}{{- end }}
54 {{- end }}
55 initContainers:
56 - name: wait-for-db
57 {{- include "openproject.containerSecurityContext" . | indent 10 }}
58 image: {{ include "openproject.image" . }}
59 imagePullPolicy: {{ .Values.image.imagePullPolicy }}
60 envFrom:
61 {{- include "openproject.envFrom" . | nindent 12 }}
62 env:
63 {{- include "openproject.env" . | nindent 12 }}
64 command:
65 - bash
66 - /app/docker/prod/wait-for-db
67 containers:
68 - name: "openproject"
69 {{- include "openproject.containerSecurityContext" . | indent 10 }}
70 image: {{ include "openproject.image" . }}
71 imagePullPolicy: {{ .Values.image.imagePullPolicy }}
72 envFrom:
73 {{- include "openproject.envFrom" . | nindent 12 }}
74 env:
75 {{- include "openproject.env" . | nindent 12 }}
76 command:
77 - bash
78 - /app/docker/prod/web
79 volumeMounts:
80 {{- include "openproject.tmpVolumeMounts" . | indent 12 }}
81 {{- if .Values.persistence.enabled }}
82 - name: "data"
83 mountPath: "/var/openproject/assets"
84 {{- end }}
85 {{- if .Values.egress.tls.rootCA.fileName }}
86 - name: ca-pemstore
87 mountPath: /etc/ssl/certs/custom-ca.pem
88 subPath: {{ .Values.egress.tls.rootCA.fileName }}
89 readOnly: false
90 {{- end }}
91 ports:
92 {{- range $key, $value := .Values.service.ports }}
93 - name: {{ $key }}
94 containerPort: {{ $value.containerPort }}
95 protocol: {{ $value.protocol }}
96 {{- end }}
97 {{- if .Values.probes.liveness.enabled }}
98 livenessProbe:
99 httpGet:
100 path: "{{ .Values.openproject.railsRelativeUrlRoot | default "" }}/health_checks/default"
101 port: 8080
102 httpHeaders:
103 # required otherwise health check will return 404 because health check is done using the Pod IP, which may cause issues with downstream variants
104 - name: Host
105 value: localhost
106 initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
107 timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
108 periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
109 failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
110 successThreshold: {{ .Values.probes.liveness.successThreshold }}
111 {{- end }}
112 {{- if .Values.probes.readiness.enabled }}
113 readinessProbe:
114 httpGet:
115 path: "{{ .Values.openproject.railsRelativeUrlRoot | default "" }}/health_checks/default"
116 port: 8080
117 httpHeaders:
118 # required otherwise health check will return 404 because health check is done using the Pod IP, which may cause issues with downstream variants
119 - name: Host
120 value: localhost
121 initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
122 timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
123 periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
124 failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
125 successThreshold: {{ .Values.probes.readiness.successThreshold }}
126 {{- end }}
127 resources:
128 {{- toYaml .Values.resources | nindent 12 }}