Skip to content

Commit

Permalink
feat(charts/portals): add hpa
Browse files Browse the repository at this point in the history
  • Loading branch information
simonostendorf committed Sep 4, 2023
1 parent a04da54 commit f6fe88e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
20 changes: 20 additions & 0 deletions charts/portals/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.hpa.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "portals.fullname" . }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "portals.fullname" . }}
minReplicas: {{ .Values.hpa.minReplicas }}
maxReplicas: {{ .Values.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.hpa.averageCPUUtilization }}
{{- end }}
20 changes: 13 additions & 7 deletions charts/portals/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
replicaCount: 1

hpa:
enabled: true
minReplicas: 1
maxReplicas: 10
averageCPUUtilization: 70

nameOverride: ""
fullnameOverride: ""

Expand Down Expand Up @@ -47,13 +53,13 @@ ingress:
- portals.fsr5.de
tls: true

resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
resources:
limits:
cpu: 200m
memory: 512Mi
requests:
cpu: 200m
memory: 512Mi

nodeSelector: {}

Expand Down

0 comments on commit f6fe88e

Please sign in to comment.