Skip to content

Commit

Permalink
feat: Added consumer specific hpa (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Jan 18, 2024
1 parent 580e68a commit c6a3616
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/posthog/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 30.40.0
version: 30.41.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
4 changes: 2 additions & 2 deletions charts/posthog/templates/worker-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec:
kind: Deployment
apiVersion: apps/v1
name: {{ template "posthog.fullname" $ }}-worker-{{ .name }}
minReplicas: {{ $.Values.worker.hpa.minpods }}
maxReplicas: {{ $.Values.worker.hpa.maxpods }}
minReplicas: {{ ( .hpa | default dict ).minpods | default $.Values.worker.hpa.minpods }}
maxReplicas: {{ ( .hpa | default dict ).maxpods | default $.Values.worker.hpa.maxpods }}
metrics:
{{- with $.Values.worker.hpa.cputhreshold }}
- type: Resource
Expand Down
25 changes: 25 additions & 0 deletions charts/posthog/tests/worker-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,28 @@ tests:
behavior:
scaleDown:
stabilizationWindowSeconds: 3600

- it: respects consumer overrides
set:
worker.enabled: true
worker:
consumers:
- name: default
hpa:
minpods: 5
maxpods: 50
hpa:
enabled: true
minpods: 2
maxpods: 10
cputhreshold: 70
behavior:
scaleDown:
stabilizationWindowSeconds: 3600
asserts:
- equal:
path: spec.minReplicas
value: 5
- equal:
path: spec.maxReplicas
value: 50

0 comments on commit c6a3616

Please sign in to comment.