Skip to content

Commit

Permalink
add horizontal pod autoscaler (#80)
Browse files Browse the repository at this point in the history
* add horizontal pod autoscaler

* fix snyk issues

* ignore SNYK-JAVA-LOG4J-1300176
  • Loading branch information
ravisingal committed Jul 23, 2021
1 parent 59f8b7d commit 16056f2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions helm/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.hpa.enabled }}
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Chart.Name }}
labels:
release: {{ .Release.Name }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
minReplicas: {{ int .Values.hpa.minReplicas }}
maxReplicas: {{ int .Values.hpa.maxReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Chart.Name }}
targetCPUUtilizationPercentage: {{ int .Values.hpa.targetCPUUtilizationPercentage }}
{{- end }}
6 changes: 6 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ logConfig:
appender:
rolling:
enabled: false

hpa:
enabled: false
minReplicas: 1
maxReplicas: 5
targetCPUUtilizationPercentage: 80

0 comments on commit 16056f2

Please sign in to comment.