Skip to content

Commit

Permalink
Merge pull request #42 from WyriHaximusNet/default-backend-use-hpa-li…
Browse files Browse the repository at this point in the history
…b-chart

[default-backend] Use HPA lib chart
  • Loading branch information
WyriHaximus authored Oct 20, 2020
2 parents c42bdf0 + 0c96234 commit 351898e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
7 changes: 5 additions & 2 deletions charts/default-backend/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ dependencies:
- name: cron-jobs
repository: https://helm.wyrihaximus.net/
version: 0.1.2
digest: sha256:b2f8a780f27427de0b317c3a6d816e404a2b375bfc9d0110f7091849113db031
generated: "2020-10-16T20:22:03.626863683+02:00"
- name: horizontal-pod-autoscalers
repository: https://helm.wyrihaximus.net/
version: 0.1.0
digest: sha256:61b09b22321149ec73892ea36de12468fa3e35b15756f8f1769c18dfe55142f9
generated: "2020-10-20T19:30:33.002238289+02:00"
5 changes: 4 additions & 1 deletion charts/default-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A Helm chart for Kubernetes
home: https://github.com/wyrihaximusnet/docker-default-backend
icon: https://helm.wyrihaximus.net/images/charts/default-backend.png
type: application
version: 0.3.0
version: 0.3.1
appVersion: random
maintainers:
- name: WyriHaximus
Expand All @@ -13,3 +13,6 @@ dependencies:
- name: cron-jobs
version: ^0.1
repository: https://helm.wyrihaximus.net/
- name: horizontal-pod-autoscalers
version: ^0.1
repository: https://helm.wyrihaximus.net/
19 changes: 1 addition & 18 deletions charts/default-backend/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
{{- if .Values.hpa.enable -}}
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "default-backend.fullname" . }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "default-backend.fullname" . }}
minReplicas: {{ .Values.replicas }}
maxReplicas: {{ .Values.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
{{- include "horizontal-pod-autoscalers.hpa" (dict "name" (include "default-backend.fullname" .) "replicas" (dict "min" .Values.replicas "max" .Values.hpa.maxReplicas)) -}}
{{ end }}

0 comments on commit 351898e

Please sign in to comment.