Skip to content

Commit

Permalink
Added consumer specific hpa
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Jan 18, 2024
1 parent 580e68a commit 2c7fb6a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
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.minpods | default $.Values.worker.hpa.minpods }}
maxReplicas: {{ .hpa.maxpods | default $.Values.worker.hpa.maxpods }}
metrics:
{{- with $.Values.worker.hpa.cputhreshold }}
- type: Resource
Expand Down
28 changes: 28 additions & 0 deletions charts/posthog/tests/worker-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,31 @@ 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
value:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: RELEASE-NAME-posthog-worker-default
minReplicas: 5
maxReplicas: 50

0 comments on commit 2c7fb6a

Please sign in to comment.