diff --git a/charts/trino/README.md b/charts/trino/README.md index de547fbe..3c2d904a 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -36,6 +36,7 @@ The following table lists the configurable parameters of the Trino chart and the | `server.autoscaling.targetCPUUtilizationPercentage` | | `50` | | `server.autoscaling.behavior` | | `{}` | | `accessControl` | | `{}` | +| `resourceGroups` | | `{}` | | `additionalNodeProperties` | | `{}` | | `additionalConfigProperties` | | `{}` | | `additionalLogProperties` | | `{}` | diff --git a/charts/trino/templates/configmap-coordinator.yaml b/charts/trino/templates/configmap-coordinator.yaml index 0af61dfa..4fb3c2cb 100644 --- a/charts/trino/templates/configmap-coordinator.yaml +++ b/charts/trino/templates/configmap-coordinator.yaml @@ -78,6 +78,12 @@ data: security.config-file={{ .Values.server.config.path }}/access-control/{{ .Values.accessControl.configFile | default "rules.json" }} {{- end }}{{- end }} +{{- if .Values.resourceGroups }} + resource-groups.properties: | + resource-groups.configuration-manager=file + resource-groups.config-file={{ .Values.server.config.path }}/resource-groups/resource-groups.json +{{- end }} + exchange-manager.properties: | exchange-manager.name={{ .Values.server.exchangeManager.name }} {{ if eq .Values.server.exchangeManager.name "filesystem" }} @@ -137,6 +143,21 @@ data: --- +{{- if .Values.resourceGroups }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: trino-resource-groups-volume-coordinator + labels: + {{- include "trino.labels" . | nindent 4 }} + app.kubernetes.io/component: coordinator +data: + resource-groups.json: |- + {{- .Values.resourceGroups.resourceGroupsConfig | 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 a6ab9811..3020b96e 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -58,6 +58,11 @@ spec: configMap: name: trino-access-control-volume-coordinator {{- end }}{{- end }} + {{- if .Values.resourceGroups }} + - name: resource-groups-volume + configMap: + name: trino-resource-groups-volume-coordinator + {{- end }} {{- if eq .Values.server.config.authenticationType "PASSWORD" }} - name: password-volume secret: @@ -109,6 +114,10 @@ spec: - mountPath: {{ .Values.server.config.path }}/access-control name: access-control-volume {{- end }}{{- end }} + {{- if .Values.resourceGroups }} + - mountPath: {{ .Values.server.config.path }}/resource-groups + name: resource-groups-volume + {{- end }} {{- range .Values.secretMounts }} - name: {{ .name }} mountPath: {{ .path }} diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 91cd5e0c..e6eccf1e 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -113,6 +113,66 @@ accessControl: {} # ] # } +resourceGroups: {} + # # Resource groups file is mounted to /etc/trino/resource-groups/resource-groups.json + # resourceGroupsConfig: |- + # { + # "rootGroups": [ + # { + # "name": "global", + # "softMemoryLimit": "80%", + # "hardConcurrencyLimit": 100, + # "maxQueued": 100, + # "schedulingPolicy": "fair", + # "jmxExport": true, + # "subGroups": [ + # { + # "name": "admin", + # "softMemoryLimit": "30%", + # "hardConcurrencyLimit": 20, + # "maxQueued": 10 + # }, + # { + # "name": "finance_human_resources", + # "softMemoryLimit": "20%", + # "hardConcurrencyLimit": 15, + # "maxQueued": 10 + # }, + # { + # "name": "general", + # "softMemoryLimit": "30%", + # "hardConcurrencyLimit": 20, + # "maxQueued": 10 + # }, + # { + # "name": "readonly", + # "softMemoryLimit": "10%", + # "hardConcurrencyLimit": 5, + # "maxQueued": 5 + # } + # ] + # } + # ], + # "selectors": [ + # { + # "user": "admin", + # "group": "global.admin" + # }, + # { + # "group": "finance|human_resources", + # "group": "global.finance_human_resources" + # }, + # { + # "user": "alice", + # "group": "global.readonly" + # }, + # { + # "group": "global.general" + # } + # ] + # } + + additionalNodeProperties: {} additionalConfigProperties: {}