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 authored and nineinchnick committed Sep 26, 2024
1 parent 455a1a8 commit 6269a34
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
7 changes: 5 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).
Example:
```yaml
objectstore: |
Expand All @@ -282,6 +282,9 @@ Fast distributed SQL query engine for big data analytics that helps you explore
connector.name=memory
memory.max-data-per-node=128MB
```
* `additionalCatalogs` - object, default: `{}`

Deprecated, use `catalogs` instead. Configure additional [catalogs](https://trino.io/docs/current/installation/deployment.html#catalog-properties).
* `env` - list, default: `[]`

additional environment variables added to every pod, specified as a list with explicit values
Expand Down
11 changes: 4 additions & 7 deletions charts/trino/templates/configmap-catalog.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if or .Values.catalogs .Values.additionalCatalogs }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,13 +8,9 @@ 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 }}
{{- $merged := merge .Values.catalogs .Values.additionalCatalogs }}
{{- range $catalogName, $catalogProperties := $merged }}
{{ $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 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 }}
Expand All @@ -45,9 +47,11 @@ spec:
- 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
Expand Down Expand Up @@ -123,8 +127,10 @@ spec:
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" }}
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 or .Values.catalogs .Values.additionalCatalogs }}
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 or .Values.catalogs .Values.additionalCatalogs }}
- 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 or .Values.catalogs .Values.additionalCatalogs }}
- mountPath: {{ .Values.server.config.path }}/catalog
name: catalog-volume
{{- end }}
- mountPath: {{ .Values.kafka.mountPath }}
name: schemas-volume
{{- range .Values.configMounts }}
Expand Down
16 changes: 12 additions & 4 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,15 @@ 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.
# @raw
# Example:
# ```yaml
Expand All @@ -309,6 +313,10 @@ additionalCatalogs: {}
# memory.max-data-per-node=128MB
# ```

additionalCatalogs: {}
# additionalCatalogs -- Deprecated, use `catalogs` instead. Configure additional
# [catalogs](https://trino.io/docs/current/installation/deployment.html#catalog-properties).

env: []
# env -- additional environment variables added to every pod, specified as a list with explicit values
# @raw
Expand Down

0 comments on commit 6269a34

Please sign in to comment.