Skip to content

Commit

Permalink
Merge branch 'main' into 0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk authored Jan 15, 2024
2 parents 469b3a8 + ddc7156 commit 98e1df2
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 2 deletions.
2 changes: 2 additions & 0 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ The following table lists the configurable parameters of the Trino chart and the
| `server.autoscaling.enabled` | | `false` |
| `server.autoscaling.maxReplicas` | | `5` |
| `server.autoscaling.targetCPUUtilizationPercentage` | | `50` |
| `server.autoscaling.behavior` | | `{}` |
| `accessControl` | | `{}` |
| `resourceGroups` | | `{}` |
| `additionalNodeProperties` | | `{}` |
| `additionalConfigProperties` | | `{}` |
| `additionalLogProperties` | | `{}` |
Expand Down
14 changes: 12 additions & 2 deletions charts/trino/templates/autoscaler.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.server.autoscaling.enabled -}}
apiVersion: autoscaling/v1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "trino.worker" . }}
Expand All @@ -14,5 +14,15 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: {{ template "trino.worker" . }}
targetCPUUtilizationPercentage: {{ .Values.server.autoscaling.targetCPUUtilizationPercentage }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.server.autoscaling.targetCPUUtilizationPercentage }}
{{ if .Values.server.autoscaling.behavior -}}
behavior:
{{- toYaml .Values.server.autoscaling.behavior | nindent 4 }}
{{- end }}
{{- end }}
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
77 changes: 77 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@ server:
enabled: false
maxReplicas: 5
targetCPUUtilizationPercentage: 50
behavior: {}
# scaleDown:
# stabilizationWindowSeconds: 300
# policies:
# - type: Percent
# value: 100
# periodSeconds: 15
# scaleUp:
# stabilizationWindowSeconds: 0
# policies:
# - type: Percent
# value: 100
# periodSeconds: 15
# - type: Pods
# value: 4
# periodSeconds: 15
# selectPolicy: Max

accessControl: {}
# type: configmap
Expand Down Expand Up @@ -96,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 98e1df2

Please sign in to comment.