Skip to content

Commit

Permalink
Merge 2c7fb6a into 580e68a
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Jan 18, 2024
2 parents 580e68a + 2c7fb6a commit b0d63da
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 b0d63da

Please sign in to comment.