Skip to content

Commit

Permalink
Optional catalogs and related configmap
Browse files Browse the repository at this point in the history
  • Loading branch information
sdaberdaku committed Sep 26, 2024
1 parent 455a1a8 commit 6a93457
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ Fast distributed SQL query engine for big data analytics that helps you explore
- custom-property1=custom-value1
- custom-property2=custom-value2
```
* `additionalCatalogs` - object, default: `{}`
* `catalogs` - object, default: `{"tpcds":"connector.name=tpcds\ntpcds.splits-per-node=4\n","tpch":"connector.name=tpch\ntpch.splits-per-node=4\n"}`

Configure additional [catalogs](https://trino.io/docs/current/installation/deployment.html#catalog-properties). The TPCH and TPCDS catalogs are always enabled by default, with 4 splits per node.
Configure [catalogs](https://trino.io/docs/current/installation/deployment.html#catalog-properties). The TPCH and TPCDS catalogs are included by default, with 4 splits per node.
Example:
```yaml
objectstore: |
Expand Down
10 changes: 3 additions & 7 deletions charts/trino/templates/configmap-catalog.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.catalogs }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,13 +8,8 @@ metadata:
{{- include "trino.labels" . | nindent 4 }}
app.kubernetes.io/component: catalogs
data:
tpch.properties: |
connector.name=tpch
tpch.splits-per-node=4
tpcds.properties: |
connector.name=tpcds
tpcds.splits-per-node=4
{{- range $catalogName, $catalogProperties := .Values.additionalCatalogs }}
{{- range $catalogName, $catalogProperties := .Values.catalogs }}
{{ $catalogName }}.properties: |
{{- $catalogProperties | nindent 4 }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ spec:
{{- 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 .Values.catalogs }}
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 }}
Expand All @@ -45,9 +47,11 @@ spec:
- name: config-volume
configMap:
name: {{ template "trino.coordinator" . }}
{{- if .Values.catalogs }}
- name: catalog-volume
configMap:
name: {{ template "trino.catalog" . }}
{{- end }}
- name: schemas-volume
configMap:
name: {{ template "trino.fullname" . }}-schemas-volume-coordinator
Expand Down Expand Up @@ -123,8 +127,10 @@ spec:
volumeMounts:
- mountPath: {{ .Values.server.config.path }}
name: config-volume
{{- if .Values.catalogs }}
- mountPath: {{ .Values.server.config.path }}/catalog
name: catalog-volume
{{- end }}
- mountPath: {{ .Values.kafka.mountPath }}
name: schemas-volume
{{- if eq .Values.accessControl.type "configmap" }}
Expand Down
6 changes: 6 additions & 0 deletions charts/trino/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ spec:
template:
metadata:
annotations:
{{- if .Values.catalogs }}
checksum/catalog-config: {{ include (print $.Template.BasePath "/configmap-catalog.yaml") . | sha256sum }}
{{- end }}
checksum/worker-config: {{ include (print $.Template.BasePath "/configmap-worker.yaml") . | sha256sum }}
{{- if .Values.worker.annotations }}
{{- tpl (toYaml .Values.worker.annotations) . | nindent 8 }}
Expand All @@ -45,9 +47,11 @@ spec:
- name: config-volume
configMap:
name: {{ template "trino.worker" . }}
{{- if .Values.catalogs }}
- name: catalog-volume
configMap:
name: {{ template "trino.catalog" . }}
{{- end }}
- name: schemas-volume
configMap:
name: {{ template "trino.fullname" . }}-schemas-volume-worker
Expand Down Expand Up @@ -94,8 +98,10 @@ spec:
volumeMounts:
- mountPath: {{ .Values.server.config.path }}
name: config-volume
{{- if .Values.catalogs }}
- mountPath: {{ .Values.server.config.path }}/catalog
name: catalog-volume
{{- end }}
- mountPath: {{ .Values.kafka.mountPath }}
name: schemas-volume
{{- range .Values.configMounts }}
Expand Down
13 changes: 9 additions & 4 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,16 @@ eventListenerProperties: []
# - custom-property2=custom-value2
# ```

additionalCatalogs: {}
# additionalCatalogs -- Configure additional
catalogs:
tpch: |
connector.name=tpch
tpch.splits-per-node=4
tpcds: |
connector.name=tpcds
tpcds.splits-per-node=4
# catalogs -- Configure
# [catalogs](https://trino.io/docs/current/installation/deployment.html#catalog-properties).
# The TPCH and TPCDS catalogs are always enabled by default, with 4 splits per
# node.
# The TPCH and TPCDS catalogs are included by default, with 4 splits per node.
# @raw
# Example:
# ```yaml
Expand Down

0 comments on commit 6a93457

Please sign in to comment.