Skip to content

Commit

Permalink
add hpa behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
florianMalbranque authored and losipiuk committed Jan 15, 2024
1 parent 97f640a commit c991681
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ 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` | | `{}` |
| `additionalNodeProperties` | | `{}` |
| `additionalConfigProperties` | | `{}` |
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 }}
17 changes: 17 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

0 comments on commit c991681

Please sign in to comment.