diff --git a/charts/trino/README.md b/charts/trino/README.md index 44465278..ddbd2418 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -40,6 +40,7 @@ The following table lists the configurable parameters of the Trino chart and the | `server.autoscaling.behavior` | | `{}` | | `accessControl` | | `{}` | | `resourceGroups` | | `{}` | +| `sessionPropertyConfig` | | `{}` | | `additionalNodeProperties` | | `{}` | | `additionalConfigProperties` | | `{}` | | `additionalLogProperties` | | `{}` | diff --git a/charts/trino/templates/configmap-coordinator.yaml b/charts/trino/templates/configmap-coordinator.yaml index fd2fc0bb..bca45e5d 100644 --- a/charts/trino/templates/configmap-coordinator.yaml +++ b/charts/trino/templates/configmap-coordinator.yaml @@ -85,6 +85,12 @@ data: resource-groups.config-file={{ .Values.server.config.path }}/resource-groups/resource-groups.json {{- end }} +{{- if .Values.sessionPropertyConfig }} + session-property-config.properties: | + session-property-config.configuration-manager=file + session-property-manager.config-file={{ .Values.server.config.path }}/session-property-config/session-property-config.json +{{- end }} + exchange-manager.properties: | exchange-manager.name={{ .Values.server.exchangeManager.name }} {{ if eq .Values.server.exchangeManager.name "filesystem" }} @@ -160,6 +166,21 @@ data: --- +{{- if .Values.sessionPropertyConfig }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: trino-session-property-config-volume-coordinator + labels: + {{- include "trino.labels" . | nindent 4 }} + app.kubernetes.io/component: coordinator +data: + session-property-config.json: |- + {{- .Values.sessionPropertyConfig.sessionPropertyConfig | nindent 4 }} +{{- end }} + +--- + apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index 4d81c4e2..6d2c5560 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -64,6 +64,11 @@ spec: configMap: name: trino-resource-groups-volume-coordinator {{- end }} + {{- if .Values.sessionPropertyConfig }} + - name: session-property-config-volume + configMap: + name: trino-session-property-config-volume-coordinator + {{- end }} {{- if or .Values.auth.passwordAuth .Values.auth.passwordAuthSecret .Values.auth.groups }} - name: file-authentication-volume secret: @@ -126,6 +131,10 @@ spec: - mountPath: {{ .Values.server.config.path }}/resource-groups name: resource-groups-volume {{- end }} + {{- if .Values.sessionPropertyConfig }} + - mountPath: {{ .Values.server.config.path }}/session-property-config + name: session-property-config-volume + {{- end }} {{- range .Values.secretMounts }} - name: {{ .name }} mountPath: {{ .path }} diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 04e0d19c..d78babb7 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -173,6 +173,31 @@ resourceGroups: {} # ] # } +sessionPropertyConfig: {} + # # Session property config file is mounted to /etc/trino/session-property-config/session-property-config.json + # sessionPropertyConfig: |- + # [ + # { + # "group": "global.admin", + # "sessionProperties": { + # "query_max_execution_time": "5h", + # "scale_writers": "true" + # } + # }, + # { + # "group": "global.finance_human_resources", + # "sessionProperties": { + # "query_max_execution_time": "3h" + # } + # }, + # { + # "group": "global.general", + # "sessionProperties": { + # "query_max_scan_physical_bytes": "1GB", + # "query_max_cpu_time": "10m" + # } + # } + # ] additionalNodeProperties: {}