Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
39 changes: 39 additions & 0 deletions charts/retool/ci/test-js-executor-hpa-option.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
rr:

# Exercises the JS executor HPA (opt-in via rr.jsExecutor.autoscaling).
# Overlaid on top of test-install-values.yaml. Covers CPU, memory, extra
# metrics, and scale behavior branches; replicaCount must be omitted from
# the Deployment when the HPA is enabled.
jsExecutor:
enabled: true
replicaCount: 3
image:
repository: tryretool/js-executor-service
tag: 3.123.4
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 8
targetCPUUtilizationPercentage: 70
targetMemoryUtilizationPercentage: 80
metrics:
- type: Pods
pods:
metric:
name: packets-per-second
target:
type: AverageValue
averageValue: 1k
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 50
periodSeconds: 60
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
44 changes: 44 additions & 0 deletions charts/retool/templates/deployment_js_executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ metadata:
{{ toYaml .Values.deployment.annotations | indent 4 }}
{{- end }}
spec:
{{- if not ((.Values.rr.jsExecutor.autoscaling).enabled) }}
replicas: {{ .Values.rr.jsExecutor.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "retool.jsExecutor.selectorLabels" . | nindent 6 }}
Expand Down Expand Up @@ -258,4 +260,46 @@ spec:
matchLabels:
{{- include "retool.jsExecutor.selectorLabels" . | nindent 6 }}
{{- end }}
{{- if (.Values.rr.jsExecutor.autoscaling).enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "retool.jsExecutor.name" . }}
labels:
{{- include "retool.jsExecutor.selectorLabels" . | nindent 4 }}
{{- include "retool.jsExecutor.labels" . | nindent 4 }}
{{- include "retool.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "retool.jsExecutor.name" . }}
minReplicas: {{ .Values.rr.jsExecutor.autoscaling.minReplicas }}
maxReplicas: {{ .Values.rr.jsExecutor.autoscaling.maxReplicas }}
metrics:
{{- if .Values.rr.jsExecutor.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.rr.jsExecutor.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.rr.jsExecutor.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
Comment thread
greptile-apps[bot] marked this conversation as resolved.
averageUtilization: {{ .Values.rr.jsExecutor.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- with .Values.rr.jsExecutor.autoscaling.metrics }}
{{- toYaml . | nindent 4 }}
{{- end }}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
{{- with .Values.rr.jsExecutor.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
14 changes: 14 additions & 0 deletions charts/retool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,20 @@ rr:

replicaCount: 1

# Horizontal Pod Autoscaler for the JS executor. Disabled by default;
# set enabled: true to opt in. When enabled, replicaCount is ignored
# and the HPA controls the replica count.
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 70
targetMemoryUtilizationPercentage: 70
# Additional HPA metrics (Pods, Object, External, or extra Resource).
# metrics: []
# Scaling behavior (stabilization windows and policies).
# behavior: {}

seccompLocalhostProfile: profiles/nsjail-seccomp.json

# JS-executor-specific environment; not inherited from the top-level
Expand Down
14 changes: 14 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,20 @@ rr:

replicaCount: 1

# Horizontal Pod Autoscaler for the JS executor. Disabled by default;
# set enabled: true to opt in. When enabled, replicaCount is ignored
# and the HPA controls the replica count.
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 70
targetMemoryUtilizationPercentage: 70
# Additional HPA metrics (Pods, Object, External, or extra Resource).
# metrics: []
# Scaling behavior (stabilization windows and policies).
# behavior: {}

seccompLocalhostProfile: profiles/nsjail-seccomp.json

# JS-executor-specific environment; not inherited from the top-level
Expand Down
Loading