Skip to content

Commit

Permalink
trino: new chart
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiidb committed Dec 4, 2023
1 parent 7750071 commit c6b9ecc
Show file tree
Hide file tree
Showing 12 changed files with 476 additions and 47 deletions.
4 changes: 2 additions & 2 deletions charts/trino/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: "375"
appVersion: "432"
description: Fast distributed SQL query engine for big data analytics that helps you
explore your data universe
home: https://trino.io/
Expand All @@ -11,4 +11,4 @@ sources:
- https://github.com/trinodb/charts
- https://github.com/trinodb/trino/tree/master/core/docker
type: application
version: 0.10.0
version: 0.14.0
43 changes: 37 additions & 6 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The following table lists the configurable parameters of the Trino chart and the
| ------------------------ | ----------------------- | -------------- |
| `image.repository` | | `"trinodb/trino"` |
| `image.pullPolicy` | | `"IfNotPresent"` |
| `image.tag` | | `"latest"` |
| `image.tag` | | `432` |
| `imagePullSecrets` | | `[{"name": "registry-credentials"}]` |
| `server.workers` | | `2` |
| `server.node.environment` | | `"production"` |
Expand All @@ -27,8 +27,6 @@ The following table lists the configurable parameters of the Trino chart and the
| `server.config.https.keystore.path` | | `""` |
| `server.config.authenticationType` | | `""` |
| `server.config.query.maxMemory` | | `"4GB"` |
| `server.config.query.maxMemoryPerNode` | | `"1GB"` |
| `server.config.memory.heapHeadroomPerNode` | | `"1GB"` |
| `server.exchangeManager.name` | | `"filesystem"` |
| `server.exchangeManager.baseDir` | | `"/tmp/trino-local-file-system-exchange-manager"` |
| `server.workerExtraConfig` | | `""` |
Expand All @@ -44,14 +42,15 @@ The following table lists the configurable parameters of the Trino chart and the
| `eventListenerProperties` | | `{}` |
| `additionalCatalogs` | | `{}` |
| `env` | | `[]` |
| `envFrom` | | `[]` |
| `initContainers` | | `{}` |
| `sidecarContainers` | | `{}` |
| `securityContext.runAsUser` | | `1000` |
| `securityContext.runAsGroup` | | `1000` |
| `shareProcessNamespace.coordinator` | | `false` |
| `shareProcessNamespace.worker` | | `false` |
| `service.type` | | `"ClusterIP"` |
| `service.port` | | `8080` |
| `nodeSelector` | | `{}` |
| `tolerations` | | `[]` |
| `affinity` | | `{}` |
| `auth` | | `{}` |
| `serviceAccount.create` | | `false` |
| `serviceAccount.name` | | `""` |
Expand All @@ -60,13 +59,45 @@ The following table lists the configurable parameters of the Trino chart and the
| `coordinator.jvm.maxHeapSize` | | `"8G"` |
| `coordinator.jvm.gcMethod.type` | | `"UseG1GC"` |
| `coordinator.jvm.gcMethod.g1.heapRegionSize` | | `"32M"` |
| `coordinator.config.memory.heapHeadroomPerNode` | | `""` |
| `coordinator.config.query.maxMemoryPerNode` | | `"1GB"` |
| `coordinator.additionalJVMConfig` | | `{}` |
| `coordinator.additionalExposedPorts` | | `{}` |
| `coordinator.resources` | | `{}` |
| `coordinator.livenessProbe` | | `{}` |
| `coordinator.readinessProbe` | | `{}` |
| `coordinator.nodeSelector` | | `{}` |
| `coordinator.tolerations` | | `[]` |
| `coordinator.affinity` | | `{}` |
| `coordinator.additionalConfigFiles` | | `{}` |
| `coordinator.annotations` | | `{}` |
| `coordinator.labels` | | `{}` |
| `coordinator.secretMounts` | | `[]` |
| `worker.jvm.maxHeapSize` | | `"8G"` |
| `worker.jvm.gcMethod.type` | | `"UseG1GC"` |
| `worker.jvm.gcMethod.g1.heapRegionSize` | | `"32M"` |
| `worker.config.memory.heapHeadroomPerNode` | | `""` |
| `worker.config.query.maxMemoryPerNode` | | `"1GB"` |
| `worker.additionalJVMConfig` | | `{}` |
| `worker.additionalExposedPorts` | | `{}` |
| `worker.resources` | | `{}` |
| `worker.livenessProbe` | | `{}` |
| `worker.readinessProbe` | | `{}` |
| `worker.nodeSelector` | | `{}` |
| `worker.tolerations` | | `[]` |
| `worker.affinity` | | `{}` |
| `worker.additionalConfigFiles` | | `{}` |
| `worker.annotations` | | `{}` |
| `worker.labels` | | `{}` |
| `worker.secretMounts` | | `[]` |
| `kafka.mountPath` | | `"/etc/trino/schemas"` |
| `kafka.tableDescriptions` | | `{}` |
| `commonLabels` | Labels that get applied to every resource's metadata | `{}` |
| `ingress.enabled` | | `false` |
| `ingress.className` | | `""` |
| `ingress.annotations` | | `{}` |
| `ingress.hosts` | | `[]` |
| `ingress.tls` | | `[]` |



Expand Down
4 changes: 4 additions & 0 deletions charts/trino/templates/autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "trino.worker" . }}
{{- if .Values.commonLabels }}
labels:
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
spec:
maxReplicas: {{ .Values.server.autoscaling.maxReplicas }}
minReplicas: {{ .Values.server.workers }}
Expand Down
3 changes: 3 additions & 0 deletions charts/trino/templates/configmap-catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
role: catalogs
{{- if .Values.commonLabels }}
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
data:
tpch.properties: |
connector.name=tpch
Expand Down
51 changes: 43 additions & 8 deletions charts/trino/templates/configmap-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: coordinator
{{- if .Values.commonLabels }}
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
data:
node.properties: |
node.environment={{ .Values.server.node.environment }}
Expand All @@ -19,20 +22,22 @@ data:

jvm.config: |
-server
-agentpath:/usr/lib/trino/bin/libjvmkill.so
-Xmx{{ .Values.coordinator.jvm.maxHeapSize }}
-XX:+{{ .Values.coordinator.jvm.gcMethod.type }}
-XX:G1HeapRegionSize={{ .Values.coordinator.jvm.gcMethod.g1.heapRegionSize }}
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
-Djdk.attach.allowAttachSelf=true
-XX:-OmitStackTraceInFastThrow
-XX:ReservedCodeCacheSize=512M
-XX:PerMethodRecompilationCutoff=10000
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
-XX:+UnlockDiagnosticVMOptions
-XX:+UseAESCTRIntrinsics
# Reduce starvation of threads by GClocker, recommend to set about the number of cpu cores (JDK-8192647)
-XX:GCLockerRetryAllocationCount=32
{{- range $configValue := .Values.coordinator.additionalJVMConfig }}
{{ $configValue }}
{{- end }}
Expand All @@ -46,9 +51,10 @@ data:
{{- end }}
http-server.http.port={{ .Values.service.port }}
query.max-memory={{ .Values.server.config.query.maxMemory }}
query.max-memory-per-node={{ .Values.server.config.query.maxMemoryPerNode }}
memory.heap-headroom-per-node={{ .Values.server.config.memory.heapHeadroomPerNode }}
discovery-server.enabled=true
query.max-memory-per-node={{ .Values.coordinator.config.query.maxMemoryPerNode }}
{{- if .Values.coordinator.config.memory.heapHeadroomPerNode }}
memory.heap-headroom-per-node={{ .Values.coordinator.config.memory.heapHeadroomPerNode }}
{{- end }}
discovery.uri=http://localhost:{{ .Values.service.port }}
{{- if .Values.server.config.authenticationType }}
http-server.authentication.type={{ .Values.server.config.authenticationType }}
Expand All @@ -74,7 +80,9 @@ data:

exchange-manager.properties: |
exchange-manager.name={{ .Values.server.exchangeManager.name }}
exchange.base-directory={{ .Values.server.exchangeManager.baseDir }}
{{ if eq .Values.server.exchangeManager.name "filesystem" }}
exchange.base-directories={{ .Values.server.exchangeManager.baseDir }}
{{- end }}
{{- range $configValue := .Values.additionalExchangeManagerProperties }}
{{ $configValue }}
{{- end }}
Expand All @@ -89,6 +97,14 @@ data:
password-authenticator.properties: |
password-authenticator.name=file
file.password-file={{ .Values.server.config.path }}/auth/password.db
{{- if .Values.auth.groups }}
group-provider.properties: |
group-provider.name=file
file.group-file={{ .Values.server.config.path }}/auth/group.db
{{- if .Values.auth.refreshPeriod }}
file.refresh-period={{ .Values.auth.refreshPeriod }}
{{- end }}
{{- end }}
{{- end }}

{{ if .Values.eventListenerProperties }}
Expand All @@ -98,6 +114,11 @@ data:
{{- end }}
{{ end }}

{{- range $fileName, $fileContent := .Values.coordinator.additionalConfigFiles }}
{{ $fileName }}: |
{{- $fileContent | nindent 4 }}
{{- end }}

---

{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
Expand All @@ -114,4 +135,18 @@ data:
{{- end }}
{{- end }}{{- end }}

---
---

apiVersion: v1
kind: ConfigMap
metadata:
name: schemas-volume-coordinator
labels:
{{- include "trino.labels" . | nindent 4 }}
app.kubernetes.io/component: coordinator
data:
{{- range $key, $val := .Values.kafka.tableDescriptions }}
{{ $key }}: {{ $val | quote }}
{{- end }}

---
40 changes: 33 additions & 7 deletions charts/trino/templates/configmap-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: worker
{{- if .Values.commonLabels }}
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
data:
node.properties: |
node.environment={{ .Values.server.node.environment }}
Expand All @@ -20,21 +23,22 @@ data:

jvm.config: |
-server
-agentpath:/usr/lib/trino/bin/libjvmkill.so
-Xmx{{ .Values.worker.jvm.maxHeapSize }}
-XX:+{{ .Values.worker.jvm.gcMethod.type }}
-XX:G1HeapRegionSize={{ .Values.worker.jvm.gcMethod.g1.heapRegionSize }}
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
-Djdk.attach.allowAttachSelf=true
-XX:-UseBiasedLocking
-XX:-OmitStackTraceInFastThrow
-XX:ReservedCodeCacheSize=512M
-XX:PerMethodRecompilationCutoff=10000
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
-XX:+UnlockDiagnosticVMOptions
-XX:+UseAESCTRIntrinsics
# Reduce starvation of threads by GClocker, recommend to set about the number of cpu cores (JDK-8192647)
-XX:GCLockerRetryAllocationCount=32
{{- range $configValue := .Values.worker.additionalJVMConfig }}
{{ $configValue }}
{{- end }}
Expand All @@ -43,8 +47,10 @@ data:
coordinator=false
http-server.http.port={{ .Values.service.port }}
query.max-memory={{ .Values.server.config.query.maxMemory }}
query.max-memory-per-node={{ .Values.server.config.query.maxMemoryPerNode }}
memory.heap-headroom-per-node={{ .Values.server.config.memory.heapHeadroomPerNode }}
query.max-memory-per-node={{ .Values.worker.config.query.maxMemoryPerNode }}
{{- if .Values.worker.config.memory.heapHeadroomPerNode }}
memory.heap-headroom-per-node={{ .Values.worker.config.memory.heapHeadroomPerNode }}
{{- end }}
discovery.uri=http://{{ template "trino.fullname" . }}:{{ .Values.service.port }}
{{- range $configValue := .Values.additionalConfigProperties }}
{{ $configValue }}
Expand All @@ -53,7 +59,9 @@ data:

exchange-manager.properties: |
exchange-manager.name={{ .Values.server.exchangeManager.name }}
exchange.base-directory={{ .Values.server.exchangeManager.baseDir }}
{{ if eq .Values.server.exchangeManager.name "filesystem" }}
exchange.base-directories={{ .Values.server.exchangeManager.baseDir }}
{{- end }}
{{- range $configValue := .Values.additionalExchangeManagerProperties }}
{{ $configValue }}
{{- end }}
Expand All @@ -71,4 +79,22 @@ data:
{{- end }}
{{ end }}

{{- range $fileName, $fileContent := .Values.worker.additionalConfigFiles }}
{{ $fileName }}: |
{{- $fileContent | nindent 4 }}
{{- end }}

---

apiVersion: v1
kind: ConfigMap
metadata:
name: schemas-volume-worker
labels:
{{- include "trino.labels" . | nindent 4 }}
app.kubernetes.io/component: worker
data:
{{- range $key, $val := .Values.kafka.tableDescriptions }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
Loading

0 comments on commit c6b9ecc

Please sign in to comment.