Skip to content

Commit

Permalink
[horizontal-pod-autoscalers] Add controlled scale down
Browse files Browse the repository at this point in the history
Overwrites the default behavior of scaling down quickly,
it slowly scales down one pod a minute. Making a possible
scale up less dramatic when it's still scaling down.

Bumped helm/kinda-action in the process.
  • Loading branch information
WyriHaximus committed Oct 21, 2020
1 parent 351898e commit 8a5602f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/helm-charts-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: git fetch --prune --unshallow

- name: Create kind cluster
uses: helm/[email protected]-alpha.3
uses: helm/[email protected]
with:
installLocalPathProvisioner: true
# Only build a kind cluster if there are chart changes to test.
Expand Down
3 changes: 2 additions & 1 deletion charts/horizontal-pod-autoscalers/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ description: Horizontal Pod Autoscalers library
home: https://github.com/wyrihaximusnet/helm-charts
icon: https://helm.wyrihaximus.net/images/charts/horizontal-pod-autoscalers.png
type: library
version: 0.1.0
version: 0.2.0
kubeVersion: ^1.18
maintainers:
- name: WyriHaximus
email: [email protected]
2 changes: 2 additions & 0 deletions charts/horizontal-pod-autoscalers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ replicas:
## Opinionated decisions
* requires kubernetes ^1.18
* 1024 max replica's
* scales when average CPU usage goes above 50%
* scaling down happens at one pod a minute
6 changes: 6 additions & 0 deletions charts/horizontal-pod-autoscalers/templates/_hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ spec:
name: {{ .name }}
minReplicas: {{ .replicas.min | default 2 }}
maxReplicas: {{ .replicas.max | default 1024 }}
behavior:
scaleDown:
policies:
- type: Pods
value: 1
periodSeconds: 60
metrics:
- type: Resource
resource:
Expand Down

0 comments on commit 8a5602f

Please sign in to comment.