forked from trinodb/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment-coordinator.yaml
252 lines (251 loc) · 10.1 KB
/
deployment-coordinator.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "trino.coordinator" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "trino.labels" . | nindent 4 }}
app.kubernetes.io/component: coordinator
{{- if .Values.coordinator.labels }}
{{- tpl (toYaml .Values.coordinator.labels) . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "trino.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: coordinator
template:
metadata:
annotations:
{{- if and (eq .Values.accessControl.type "configmap") (not .Values.accessControl.refreshPeriod) }}
checksum/access-control-config: {{ include (print $.Template.BasePath "/configmap-access-control.yaml") . | sha256sum }}
{{- end }}
{{- if or .Values.catalogs .Values.additionalCatalogs }}
checksum/catalog-config: {{ include (print $.Template.BasePath "/configmap-catalog.yaml") . | sha256sum }}
{{- end }}
checksum/coordinator-config: {{ include (print $.Template.BasePath "/configmap-coordinator.yaml") . | sha256sum }}
{{- if .Values.coordinator.annotations }}
{{- tpl (toYaml .Values.coordinator.annotations) . | nindent 8 }}
{{- end }}
labels:
{{- include "trino.labels" . | nindent 8 }}
app.kubernetes.io/component: coordinator
{{- if .Values.coordinator.labels }}
{{- tpl (toYaml .Values.coordinator.labels) . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "trino.serviceAccountName" . }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.shareProcessNamespace.coordinator }}
shareProcessNamespace: {{ .Values.shareProcessNamespace.coordinator }}
{{- end }}
volumes:
- name: config-volume
configMap:
name: {{ template "trino.coordinator" . }}
{{- if or .Values.catalogs .Values.additionalCatalogs }}
- name: catalog-volume
configMap:
name: {{ template "trino.catalog" . }}
{{- end }}
- name: schemas-volume
configMap:
name: {{ template "trino.fullname" . }}-schemas-volume-coordinator
{{- if eq .Values.accessControl.type "configmap" }}
- name: access-control-volume
configMap:
name: {{ template "trino.fullname" . }}-access-control-volume-coordinator
{{- end }}
{{- if .Values.resourceGroups }}
- name: resource-groups-volume
configMap:
name: {{ template "trino.fullname" . }}-resource-groups-volume-coordinator
{{- end }}
{{- if or .Values.auth.passwordAuth .Values.auth.passwordAuthSecret }}
- name: file-password-authentication-volume
secret:
secretName: {{ template "trino.filePasswordAuthSecretName" . }}
items:
- key: password.db
path: password.db
{{- end }}
{{- if or .Values.auth.groups .Values.auth.groupsAuthSecret }}
- name: file-groups-authentication-volume
secret:
secretName: {{ template "trino.fileGroupAuthSecretName" . }}
items:
- key: group.db
path: group.db
{{- end }}
{{- if .Values.jmx.exporter.enabled }}
- name: jmx-exporter-config-volume
configMap:
name: {{ template "trino.fullname" . }}-jmx-exporter-config
{{- end }}
{{- range .Values.configMounts }}
- name: {{ .name }}
configMap:
name: {{ .configMap }}
{{- end }}
{{- range .Values.coordinator.configMounts }}
- name: {{ .name }}
configMap:
name: {{ .configMap }}
{{- end }}
{{- range .Values.secretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- end }}
{{- range .Values.coordinator.secretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- end }}
{{- with .Values.coordinator.additionalVolumes }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.initContainers.coordinator }}
initContainers:
{{- tpl (toYaml .Values.initContainers.coordinator) . | nindent 6 }}
{{- end }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.coordinator.terminationGracePeriodSeconds }}
containers:
- name: {{ .Chart.Name }}-coordinator
image: {{ include "trino.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
env:
{{- toYaml .Values.env | nindent 12 }}
envFrom:
{{- toYaml .Values.envFrom | nindent 12 }}
volumeMounts:
- mountPath: {{ .Values.server.config.path }}
name: config-volume
{{- if or .Values.catalogs .Values.additionalCatalogs }}
- mountPath: {{ .Values.server.config.path }}/catalog
name: catalog-volume
{{- end }}
- mountPath: {{ .Values.kafka.mountPath }}
name: schemas-volume
{{- if eq .Values.accessControl.type "configmap" }}
- mountPath: {{ .Values.server.config.path }}/access-control
name: access-control-volume
{{- end }}
{{- if .Values.resourceGroups }}
- mountPath: {{ .Values.server.config.path }}/resource-groups
name: resource-groups-volume
{{- end }}
{{- range .Values.configMounts }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- end }}
{{- range .Values.coordinator.configMounts }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- end }}
{{- range .Values.secretMounts }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- end }}
{{- range .Values.coordinator.secretMounts }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- end }}
{{- if or .Values.auth.passwordAuth .Values.auth.passwordAuthSecret }}
- mountPath: {{ .Values.server.config.path }}/auth/password
name: file-password-authentication-volume
{{- end }}
{{- if or .Values.auth.groups .Values.auth.groupsAuthSecret }}
- mountPath: {{ .Values.server.config.path }}/auth/group
name: file-group-authentication-volume
{{- end }}
{{- with .Values.coordinator.additionalVolumeMounts }}
{{- . | toYaml | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
{{- with .Values.jmx }}
{{- if .enabled }}
- name: jmx-registry
containerPort: {{ .registryPort }}
protocol: TCP
- name: jmx-server
containerPort: {{ .serverPort }}
protocol: TCP
{{- end }}
{{- end }}
{{- range $key, $value := .Values.coordinator.additionalExposedPorts }}
- name: {{ $value.name }}
containerPort: {{ $value.port }}
protocol: {{ $value.protocol }}
{{- end }}
livenessProbe:
httpGet:
path: /v1/info
port: http
initialDelaySeconds: {{ .Values.coordinator.livenessProbe.initialDelaySeconds | default 30 }}
periodSeconds: {{ .Values.coordinator.livenessProbe.periodSeconds | default 10 }}
timeoutSeconds: {{ .Values.coordinator.livenessProbe.timeoutSeconds | default 5 }}
failureThreshold: {{ .Values.coordinator.livenessProbe.failureThreshold | default 6 }}
successThreshold: {{ .Values.coordinator.livenessProbe.successThreshold | default 1 }}
readinessProbe:
exec:
command: [/usr/lib/trino/bin/health-check]
initialDelaySeconds: {{ .Values.coordinator.readinessProbe.initialDelaySeconds | default 10 }}
periodSeconds: {{ .Values.coordinator.readinessProbe.periodSeconds | default 10 }}
timeoutSeconds: {{ .Values.coordinator.readinessProbe.timeoutSeconds | default 5 }}
failureThreshold: {{ .Values.coordinator.readinessProbe.failureThreshold | default 6 }}
successThreshold: {{ .Values.coordinator.readinessProbe.successThreshold | default 1 }}
lifecycle:
{{- toYaml .Values.coordinator.lifecycle | nindent 12 }}
resources:
{{- toYaml .Values.coordinator.resources | nindent 12 }}
{{- with .Values.jmx.exporter }}
{{- if .enabled }}
- name: jmx-exporter
image: {{ .image }}
imagePullPolicy: {{ .pullPolicy }}
{{- with .securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
args:
- "{{ .port }}"
- /etc/jmx-exporter/jmx-exporter-config.yaml
volumeMounts:
- mountPath: /etc/jmx-exporter/
name: jmx-exporter-config-volume
{{- with .resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: jmx-exporter
containerPort: {{ .port }}
protocol: TCP
{{- end }}
{{- end }}
{{- if .Values.sidecarContainers.coordinator }}
{{- toYaml .Values.sidecarContainers.coordinator | nindent 8 }}
{{- end }}
{{- with .Values.coordinator.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coordinator.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coordinator.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}