Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle resource group file #119

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The following table lists the configurable parameters of the Trino chart and the
| `server.autoscaling.maxReplicas` | | `5` |
| `server.autoscaling.targetCPUUtilizationPercentage` | | `50` |
| `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 @@ -96,6 +96,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
Loading