Skip to content

Commit

Permalink
Merge pull request #39 from WyriHaximusNet/redirect-add-hpa
Browse files Browse the repository at this point in the history
[redirect] Add HPA
  • Loading branch information
WyriHaximus authored Oct 18, 2020
2 parents 2d2c115 + ec7c808 commit 90ab24b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/redirect/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Redirect
home: https://github.com/wyrihaximusnet/docker-redirect
icon: https://helm.wyrihaximus.net/images/charts/redirect.png
type: application
version: 0.5.5
version: 0.6.0
appVersion: random
maintainers:
- name: WyriHaximus
Expand Down
4 changes: 4 additions & 0 deletions charts/redirect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ redirect:
www.ceesjankiewiet.nl: wyrihaximus.net
ingressHosts:
- www.wyrihaximus.net

# Enable horizontal pod autoscaler
hpa:
enable: true
```
Keep in mind that the configuration options are executed in the following order:
Expand Down
3 changes: 3 additions & 0 deletions charts/redirect/ci/single-replica-values.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
replicas: 1

hpa:
enable: true
20 changes: 20 additions & 0 deletions charts/redirect/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- 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 }}
4 changes: 4 additions & 0 deletions charts/redirect/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ grafana:

replicas: 2

hpa:
enable: false
maxReplicas: 1024

# Available tags: https://github.com/wyrihaximusnet/docker-redirect#provided-tags
image:
repository: wyrihaximusnet/redirect
Expand Down

0 comments on commit 90ab24b

Please sign in to comment.