-
Notifications
You must be signed in to change notification settings - Fork 2
/
trino.yaml
276 lines (276 loc) · 7.45 KB
/
trino.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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
---
apiVersion: v1
kind: Namespace
metadata:
name: trino
---
# we do this because both the coordinator and workers need to have the same set of configs, and should be treated as an atomic group
kind: ConfigMap
apiVersion: v1
metadata:
name: trino-configs
namespace: trino
data:
jvm.config: |-
-server
-Xmx2G
-XX:-UseBiasedLocking
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+ExplicitGCInvokesConcurrent
-XX:+ExitOnOutOfMemoryError
-XX:+UseGCOverheadLimit
-XX:+HeapDumpOnOutOfMemoryError
-XX:ReservedCodeCacheSize=512M
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
config.properties.coordinator: |-
coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=8080
query.max-memory=1GB
query.max-memory-per-node=1GB
#query.max-total-memory-per-node=1GB
query.max-stage-count=200
task.writer-count=4
discovery-server.enabled=true
discovery.uri=http://trino:8080
config.properties.worker: |-
coordinator=false
http-server.http.port=8080
query.max-memory=1GB
query.max-memory-per-node=1GB
query.max-stage-count=200
task.writer-count=4
discovery.uri=http://trino:8080
node.properties: |-
node.environment=test
spiller-spill-path=/tmp
max-spill-per-node=4TB
query-max-spill-per-node=1TB
hive.properties: |-
connector.name=hive-hadoop2
hive.metastore.uri=thrift://metastore.hive.svc.cluster.local:9083
hive.allow-drop-table=true
#hive.max-partitions-per-scan=1000000
hive.s3.endpoint=minio.minio.svc.cluster.local:9000
hive.s3.path-style-access=true
hive.s3.ssl.enabled=false
hive.s3.max-connections=100
hive.s3.aws-access-key=${ENV:AWS_ACCESS_KEY_ID}
hive.s3.aws-secret-key=${ENV:AWS_SECRET_ACCESS_KEY}
hive.allow-add-column=true
hive.allow-drop-column=true
hive.allow-rename-table=true
hive.allow-rename-column=true
hive.metastore-timeout=300s
iceberg.properties: |-
connector.name=iceberg
hive.metastore.uri=thrift://metastore.hive.svc.cluster.local:9083
#hive.max-partitions-per-scan=1000000
hive.s3.endpoint=minio.minio.svc.cluster.local:9000
hive.s3.path-style-access=true
hive.s3.ssl.enabled=false
hive.s3.max-connections=100
postgres.properties: |-
connector.name=postgresql
connection-url=jdbc:postgresql://postgres.postgres.svc.cluster.local:5432/${ENV:POSTGRES_DB}?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC
connection-user=${ENV:POSTGRES_USER}
connection-password=${ENV:POSTGRES_PASSWORD}
---
# same secret as in minio namespace, the minio admin account - for ease of use (s3 key/secret)
apiVersion: v1
kind: Secret
metadata:
name: minio-admin
namespace: trino
data:
username: YWRtaW4= #admin
password: YWRtaW5wYXNzd29yZDEyMw== #adminpassword123
---
apiVersion: v1
kind: Secret
metadata:
name: postgres-admin
namespace: trino
data:
db: cG9zdGdyZXM= #postgres
password: cG9zdGdyZXNzcGFzc3dvcmQxMjM= #postgresspassword123
user: cG9zdGdyZXM= #postgres
---
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: trino-coordinator
namespace: trino
spec:
selector:
matchLabels:
app: trino-coordinator
strategy:
type: Recreate
template:
metadata:
labels:
app: trino-coordinator
spec:
containers:
- name: trino
image: trinodb/trino:386
ports:
- containerPort: 8080
env:
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: postgres-admin
key: db
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: postgres-admin
key: user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-admin
key: password
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: minio-admin
key: username
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: minio-admin
key: password
volumeMounts:
- name: trino-cfg-vol
mountPath: /etc/trino/jvm.config
subPath: jvm.config
- name: trino-cfg-vol
mountPath: /etc/trino/config.properties
subPath: config.properties.coordinator
- name: trino-cfg-vol
mountPath: /etc/trino/node.properties
subPath: node.properties
- name: trino-cfg-vol
mountPath: /etc/trino/catalog/hive.properties
subPath: hive.properties
- name: trino-cfg-vol
mountPath: /etc/trino/catalog/iceberg.properties
subPath: iceberg.properties
- name: trino-cfg-vol
mountPath: /etc/trino/catalog/postgres.properties
subPath: postgres.properties
resources:
requests:
memory: "1G"
imagePullPolicy: Always
volumes:
- name: trino-cfg-vol
configMap:
name: trino-configs
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: trino-worker
namespace: trino
spec:
serviceName: trino-worker
replicas: 2
selector:
matchLabels:
app: trino-worker
template:
metadata:
labels:
app: trino-worker
spec:
securityContext:
fsGroup: 1000
containers:
- name: trino
image: trinodb/trino:386
ports:
- containerPort: 8080
env:
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: postgres-admin
key: db
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: postgres-admin
key: user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-admin
key: password
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: minio-admin
key: username
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: minio-admin
key: password
volumeMounts:
- name: trino-cfg-vol
mountPath: /etc/trino/jvm.config
subPath: jvm.config
- name: trino-cfg-vol
mountPath: /etc/trino/config.properties
subPath: config.properties.worker
- name: trino-cfg-vol
mountPath: /etc/trino/node.properties
subPath: node.properties
- name: trino-cfg-vol
mountPath: /etc/trino/catalog/hive.properties
subPath: hive.properties
- name: trino-cfg-vol
mountPath: /etc/trino/catalog/iceberg.properties
subPath: iceberg.properties
- name: trino-cfg-vol
mountPath: /etc/trino/catalog/postgres.properties
subPath: postgres.properties
- name: trino-tmp-data
mountPath: /tmp
resources:
requests:
memory: "1G"
imagePullPolicy: Always
volumes:
- name: trino-cfg-vol
configMap:
name: trino-configs
volumeClaimTemplates:
- metadata:
name: trino-tmp-data
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
name: trino
namespace: trino
spec:
type: LoadBalancer
ports:
- port: 8080
selector:
app: trino-coordinator