Skip to content

Commit

Permalink
[redirect] Use HPA lib chart
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Oct 20, 2020
1 parent f69d275 commit e37d7f5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
6 changes: 6 additions & 0 deletions charts/redirect/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: horizontal-pod-autoscalers
repository: https://helm.wyrihaximus.net/
version: 0.1.0
digest: sha256:b69c147f2b6a3d345e7155979fc23ff6bbf4fa0c3822d1d9f64691ab29d9778c
generated: "2020-10-20T19:31:36.647230414+02:00"
6 changes: 5 additions & 1 deletion charts/redirect/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ description: Redirect
home: https://github.com/wyrihaximusnet/docker-redirect
icon: https://helm.wyrihaximus.net/images/charts/redirect.png
type: application
version: 0.6.0
version: 0.6.1
appVersion: random
maintainers:
- name: WyriHaximus
email: [email protected]
dependencies:
- name: horizontal-pod-autoscalers
version: ^0.1
repository: https://helm.wyrihaximus.net/
21 changes: 2 additions & 19 deletions charts/redirect/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 ".helm.fullname" . }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template ".helm.fullname" . }}
minReplicas: {{ .Values.replicas }}
maxReplicas: {{ .Values.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
{{ end }}
{{- include "horizontal-pod-autoscalers.hpa" (dict "name" (include ".helm.fullname" .) "replicas" (dict "min" .Values.replicas "max" .Values.hpa.maxReplicas)) -}}
{{ end }}

0 comments on commit e37d7f5

Please sign in to comment.