-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathdremio-master.yaml
More file actions
232 lines (232 loc) · 8.7 KB
/
dremio-master.yaml
File metadata and controls
232 lines (232 loc) · 8.7 KB
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
{{- if not $.Values.DremioAdmin -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: dremio-master
{{- include "dremio.coordinator.annotations" $ | nindent 2}}
{{- include "dremio.coordinator.labels" $ | nindent 2}}
spec:
serviceName: "dremio-cluster-pod"
podManagementPolicy: "Parallel"
replicas: 1
selector:
matchLabels:
app: dremio-coordinator
template:
metadata:
labels:
app: dremio-coordinator
role: dremio-cluster-pod
{{- include "dremio.coordinator.podLabels" $ | nindent 8}}
annotations:
dremio-configmap/checksum: {{ (tpl ($.Files.Glob "config/*").AsConfig $) | sha256sum }}
{{- include "dremio.coordinator.podAnnotations" $ | nindent 8}}
spec:
{{- include "dremio.coordinator.serviceAccount" $ | nindent 6 }}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- dremio-coordinator
topologyKey: "kubernetes.io/hostname"
terminationGracePeriodSeconds: 120
{{- include "dremio.coordinator.nodeSelector" $ | nindent 6 }}
{{- include "dremio.coordinator.tolerations" $ | nindent 6 }}
containers:
- name: dremio-master-coordinator
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: {{ $.Values.coordinator.cpu }}
memory: {{ $.Values.coordinator.memory }}Mi
volumeMounts:
- name: dremio-master-volume
mountPath: /opt/dremio/data
- name: dremio-config
mountPath: /opt/dremio/conf
- name: dremio-hive2-config
mountPath: /opt/dremio/plugins/connectors/hive2.d
- name: dremio-hive2-config
mountPath: /opt/dremio/plugins/connectors/hive2-ee.d
- name: dremio-hive3-config
mountPath: /opt/dremio/plugins/connectors/hive3.d
- name: dremio-hive3-config
mountPath: /opt/dremio/plugins/connectors/hive3-ee.d
{{- if or $.Values.coordinator.web.tls.enabled (or $.Values.coordinator.client.tls.enabled $.Values.coordinator.flight.tls.enabled) }}
- name: dremio-tls
mountPath: /opt/dremio/tls
{{- end }}
{{- include "dremio.coordinator.extraVolumeMounts" $ | nindent 8 }}
env:
- name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB
value: "{{ template "dremio.coordinator.heapMemory" $ }}"
- name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB
value: "{{ template "dremio.coordinator.directMemory" $ }}"
- name: DREMIO_JAVA_SERVER_EXTRA_OPTS
value: >-
{{- include "dremio.coordinator.extraStartParams" $ | nindent 12 -}}
-Dzookeeper=zk-hs:2181
-Dservices.coordinator.enabled=true
-Dservices.coordinator.master.enabled=true
-Dservices.coordinator.master.embedded-zookeeper.enabled=false
-Dservices.executor.enabled=false
-Dservices.conduit.port=45679
- name: AWS_CREDENTIAL_PROFILES_FILE
value: "/opt/dremio/aws/credentials"
- name: AWS_SHARED_CREDENTIALS_FILE
value: "/opt/dremio/aws/credentials"
command: ["/opt/dremio/bin/dremio"]
args:
- "start-fg"
ports:
- containerPort: 9047
name: web
- containerPort: 31010
name: client
- containerPort: 32010
name: flight
- containerPort: 45678
name: server-fabric
- containerPort: 45679
name: server-conduit
readinessProbe:
httpGet:
path: /
{{- if $.Values.coordinator.web.tls.enabled }}
scheme: HTTPS
{{- end }}
port: 9047
initialDelaySeconds: 5
periodSeconds: 5
initContainers:
{{- include "dremio.coordinator.extraInitContainers" $ | nindent 6 }}
- name: start-only-one-dremio-master
image: busybox
securityContext:
capabilities:
add:
- NET_RAW
command: ["sh", "-c", "INDEX=${HOSTNAME##*-}; if [ $INDEX -ne 0 ]; then echo Only one master should be running.; exit 1; fi; "]
- name: wait-for-zookeeper
image: busybox
command: ["sh", "-c", "until ping -c 1 -W 1 zk-hs > /dev/null; do echo Waiting for Zookeeper to be ready.; sleep 2; done;"]
- name: chown-data-directory
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 0
volumeMounts:
- name: dremio-master-volume
mountPath: /opt/dremio/data
command: ["chown"]
args:
- "dremio:dremio"
- "/opt/dremio/data"
- name: upgrade-task
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
imagePullPolicy: IfNotPresent
volumeMounts:
- name: dremio-master-volume
mountPath: /opt/dremio/data
- name: dremio-config
mountPath: /opt/dremio/conf
command: ["/opt/dremio/bin/dremio-admin"]
args:
- "upgrade"
{{- if $.Values.coordinator.web.tls.enabled }}
- name: generate-ui-keystore
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
imagePullPolicy: IfNotPresent
volumeMounts:
- name: dremio-tls
mountPath: /opt/dremio/tls
- name: dremio-tls-secret-ui
mountPath: /dremio-tls-secret
command: ["/usr/bin/openssl"]
args: ["pkcs12", "-export", "-inkey", "/dremio-tls-secret/tls.key", "-in", "/dremio-tls-secret/tls.crt", "-out", "/opt/dremio/tls/ui.pkcs12", "-passout", "pass:"]
{{- end }}
{{- if $.Values.coordinator.client.tls.enabled }}
- name: generate-client-keystore
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
imagePullPolicy: IfNotPresent
volumeMounts:
- name: dremio-tls
mountPath: /opt/dremio/tls
- name: dremio-tls-secret-client
mountPath: /dremio-tls-secret
command: ["/usr/bin/openssl"]
args: ["pkcs12", "-export", "-inkey", "/dremio-tls-secret/tls.key", "-in", "/dremio-tls-secret/tls.crt", "-out", "/opt/dremio/tls/client.pkcs12", "-passout", "pass:"]
{{- end }}
{{- if $.Values.coordinator.flight.tls.enabled }}
- name: generate-flight-keystore
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
imagePullPolicy: IfNotPresent
volumeMounts:
- name: dremio-tls
mountPath: /opt/dremio/tls
- name: dremio-tls-secret-flight
mountPath: /dremio-tls-secret
command: ["/usr/bin/openssl"]
args: ["pkcs12", "-export", "-inkey", "/dremio-tls-secret/tls.key", "-in", "/dremio-tls-secret/tls.crt", "-out", "/opt/dremio/tls/flight.pkcs12", "-passout", "pass:"]
{{- end }}
volumes:
- name: dremio-config
configMap:
name: dremio-config
- name: dremio-hive2-config
configMap:
name: dremio-hive2-config
- name: dremio-hive3-config
configMap:
name: dremio-hive3-config
{{- if or $.Values.coordinator.web.tls.enabled (or $.Values.coordinator.client.tls.enabled $.Values.coordinator.flight.tls.enabled) }}
- name: dremio-tls
emptyDir: {}
{{- end }}
{{- if $.Values.coordinator.web.tls.enabled }}
- name: dremio-tls-secret-ui
secret:
secretName: {{ $.Values.coordinator.web.tls.secret }}
items:
- key: tls.key
path: tls.key
- key: tls.crt
path: tls.crt
{{- end }}
{{- if $.Values.coordinator.client.tls.enabled }}
- name: dremio-tls-secret-client
secret:
secretName: {{ $.Values.coordinator.client.tls.secret }}
items:
- key: tls.key
path: tls.key
- key: tls.crt
path: tls.crt
{{- end }}
{{- if $.Values.coordinator.flight.tls.enabled }}
- name: dremio-tls-secret-flight
secret:
secretName: {{ $.Values.coordinator.flight.tls.secret }}
items:
- key: tls.key
path: tls.key
- key: tls.crt
path: tls.crt
{{- end }}
{{- include "dremio.coordinator.extraVolumes" $ | nindent 6 }}
{{- include "dremio.imagePullSecrets" $ | nindent 6 }}
volumeClaimTemplates:
- metadata:
name: dremio-master-volume
spec:
accessModes: ["ReadWriteOnce"]
{{- include "dremio.coordinator.storageClass" $ | nindent 6 }}
resources:
requests:
storage: {{ $.Values.coordinator.volumeSize }}
{{- end -}}