diff --git a/charts/trino/README.md b/charts/trino/README.md index 5297126b..72904bdc 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -28,6 +28,9 @@ The following table lists the configurable parameters of the Trino chart and the | `server.jvm.maxHeapSize` | | `"8G"` | | `server.jvm.gcMethod.type` | | `"UseG1GC"` | | `server.jvm.gcMethod.g1.heapRegionSize` | | `"32M"` | +| `server.autoscaling.enabled` | | `false` | +| `server.autoscaling.maxReplicas` | | `5` | +| `server.autoscaling.targetCPUUtilizationPercentage` | | `50` | | `additionalNodeProperties` | | `{}` | | `additionalJVMConfig` | | `{}` | | `additionalConfigProperties` | | `{}` | diff --git a/charts/trino/templates/autoscaler.yaml b/charts/trino/templates/autoscaler.yaml new file mode 100644 index 00000000..7907d1d1 --- /dev/null +++ b/charts/trino/templates/autoscaler.yaml @@ -0,0 +1,14 @@ +{{- if .Values.server.autoscaling.enabled -}} +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "trino.worker" . }} +spec: + maxReplicas: {{ .Values.server.autoscaling.maxReplicas }} + minReplicas: {{ .Values.server.workers }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "trino.worker" . }} + targetCPUUtilizationPercentage: {{ .Values.server.autoscaling.targetCPUUtilizationPercentage }} +{{- end }} diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 5943fd8e..190c08cf 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -32,6 +32,10 @@ server: type: "UseG1GC" g1: heapRegionSize: "32M" + autoscaling: + enabled: false + maxReplicas: 5 + targetCPUUtilizationPercentage: 50 additionalNodeProperties: {}