-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathdeployment-web.yaml
198 lines (198 loc) · 8.77 KB
/
deployment-web.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "galaxy.fullname" . }}-web
labels:
{{- include "galaxy.labels" . | nindent 4 }}
{{- with .Values.webHandlers.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
replicas: {{ .Values.webHandlers.replicaCount }}
selector:
matchLabels:
{{- include "galaxy.selectorLabels" $ | nindent 6 }}
app.kubernetes.io/component: galaxy-web-handler
template:
metadata:
labels:
{{- include "galaxy.selectorLabels" $ | nindent 8 }}
app.kubernetes.io/component: galaxy-web-handler
annotations:
checksum/galaxy_conf: {{ include (print $.Template.BasePath "/configs-galaxy.yaml") . | sha256sum }}
checksum/galaxy_rules: {{ include (print $.Template.BasePath "/configmap-galaxy-rules.yaml") . | sha256sum }}
checksum/galaxy_extras: {{ include (print $.Template.BasePath "/configmap-extra-files.yaml") . | sha256sum }}
{{- with .Values.webHandlers.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "galaxy.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}
{{- if .Values.webHandlers.podSpecExtra -}}
{{- tpl (toYaml .Values.webHandlers.podSpecExtra) . | nindent 6 }}
{{- end }}
initContainers:
- name: {{ .Chart.Name }}-wait-db
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ['sh', '-c', '{{ include "galaxy.init-container-wait-command" . }} sleep {{ .Values.webHandlers.startupDelay }};']
volumeMounts:
- name: galaxy-data
mountPath: /galaxy/server/config/mutable/
subPath: config
{{- if .Values.extraInitContainers -}}
{{- range $each := .Values.extraInitContainers -}}
{{- if $each.applyToWeb -}}
{{- print "- " | nindent 8 -}}
{{- tpl ((unset (unset (unset ($each | deepCopy) "applyToJob") "applyToWeb") "applyToWorkflow") | toYaml | indent 10 | trim) $ -}}
{{- end }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-web
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: galaxy-http
containerPort: 8080
protocol: TCP
env:
{{ include "galaxy.podEnvVars" . }}
args: [
'sh', '-c',
'{{- if .Values.extraInitCommands -}}
{{- tpl .Values.extraInitCommands $ | nindent 13 }};
{{- end -}}
/galaxy/server/.venv/bin/gunicorn "galaxy.webapps.galaxy.fast_factory:factory()" --timeout {{ .Values.webHandlers.gunicorn.timeout | default 300 }} --pythonpath /galaxy/server/lib -k galaxy.webapps.galaxy.workers.Worker -b 0.0.0.0:8080 --workers={{ .Values.webHandlers.gunicorn.workers | default 1 }} --config python:galaxy.web_stack.gunicorn_config --preload {{ .Values.webHandlers.gunicorn.extraArgs | default "" }}']
{{- if .Values.webHandlers.startupProbe.enabled }}
startupProbe:
httpGet:
path: {{ template "galaxy.add_trailing_slash" .Values.ingress.path }}api/version
port: 8080
initialDelaySeconds: {{ .Values.webHandlers.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.webHandlers.startupProbe.periodSeconds }}
failureThreshold: {{ .Values.webHandlers.startupProbe.failureThreshold }}
timeoutSeconds: {{ .Values.webHandlers.startupProbe.failureThreshold }}
{{- end }}
{{- if .Values.webHandlers.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: {{ template "galaxy.add_trailing_slash" .Values.ingress.path }}api/version
port: 8080
initialDelaySeconds: {{ .Values.webHandlers.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.webHandlers.readinessProbe.periodSeconds }}
failureThreshold: {{ .Values.webHandlers.readinessProbe.failureThreshold }}
timeoutSeconds: {{ .Values.webHandlers.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.webHandlers.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: {{ template "galaxy.add_trailing_slash" .Values.ingress.path }}api/version
port: 8080
initialDelaySeconds: {{ .Values.webHandlers.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.webHandlers.livenessProbe.periodSeconds }}
failureThreshold: {{ .Values.webHandlers.livenessProbe.failureThreshold }}
timeoutSeconds: {{ .Values.webHandlers.livenessProbe.failureThreshold }}
{{- end }}
volumeMounts:
{{- range $key, $entry := .Values.extraFileMappings -}}
{{- if $entry.applyToWeb }}
- name: {{ include "galaxy.getExtraFilesUniqueName" $key }}
mountPath: {{ $key }}
subPath: {{ include "galaxy.getFilenameFromPath" $key }}
{{- end }}
{{- end }}
{{- range $key,$entry := .Values.configs }}
{{ if $entry -}}
- name: galaxy-conf-files
mountPath: /galaxy/server/config/{{ $key }}
subPath: {{ $key }}
{{- end -}}
{{- end }}
{{- range $key,$entry := .Values.jobs.rules }}
- name: galaxy-job-rules
mountPath: /galaxy/server/lib/galaxy/jobs/rules/{{ $key }}
subPath: {{ $key }}
{{- end }}
- name: galaxy-data
mountPath: {{ .Values.persistence.mountPath }}
- name: galaxy-data
mountPath: /galaxy/server/config/mutable/
subPath: config
{{- if .Values.setupJob.downloadToolConfs.enabled }}
- name: galaxy-data
mountPath: {{ .Values.setupJob.downloadToolConfs.volume.mountPath }}
subPath: {{ .Values.setupJob.downloadToolConfs.volume.subPath }}
{{- end }}
{{- if .Values.refdata.enabled }}
- name: refdata-gxy
mountPath: /cvmfs/data.galaxyproject.org
subPath: data.galaxyproject.org
{{- if eq .Values.refdata.type "cvmfs" }}
# CVMFS automount volumes must be mounted with HostToContainer mount propagation.
mountPropagation: HostToContainer
{{- end }}
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- tpl (.Values.extraVolumeMounts | toYaml | nindent 12) . }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: galaxy-conf-files
{{- if .Values.useSecretConfigs }}
secret:
secretName: {{ template "galaxy.fullname" . }}-configs
{{- else }}
configMap:
name: {{ template "galaxy.fullname" . }}-configs
{{- end }}
{{- range $key, $entry := .Values.extraFileMappings -}}
{{- if $entry.applyToWeb }}
- name: {{ include "galaxy.getExtraFilesUniqueName" $key }}
{{- if $entry.useSecret }}
secret:
secretName: {{ printf "%s-%s" (include "galaxy.fullname" $) (include "galaxy.getExtraFilesUniqueName" $key) }}
{{- else }}
configMap:
name: {{ printf "%s-%s" (include "galaxy.fullname" $) (include "galaxy.getExtraFilesUniqueName" $key) }}
{{- end }}
{{- end }}
{{- end }}
- name: galaxy-job-rules
configMap:
name: {{ template "galaxy.fullname" . }}-job-rules
- name: galaxy-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "galaxy.pvcname" . }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.refdata.enabled }}
- name: refdata-gxy
persistentVolumeClaim:
claimName: {{ template "galaxy.fullname" $ -}}-refdata-gxy-pvc
{{- end }}
{{- if .Values.extraVolumes }}
{{- tpl (.Values.extraVolumes | toYaml | nindent 8) . }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}