Skip to content

Commit

Permalink
handle resource group file
Browse files Browse the repository at this point in the history
refact json import and volume mount

fix indenting

fix lint
  • Loading branch information
fl0-m authored and losipiuk committed Jan 15, 2024
1 parent 6a9939d commit ddc7156
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` | | `{}` |
Expand Down
21 changes: 21 additions & 0 deletions charts/trino/templates/configmap-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }}
Expand Down Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down
60 changes: 60 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down

0 comments on commit ddc7156

Please sign in to comment.