added optional HPA (cpu/memory) to Helm chart

This commit is contained in:
Stefan Prodan
2018-01-26 17:29:51 +02:00
parent d7c669caa8
commit 5dd24cd3ad
2 changed files with 28 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
{{- if .Values.hpa.enabled -}}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "podinfo.fullname" . }}
spec:
scaleTargetRef:
apiVersion: apps/v1beta2
kind: Deployment
name: {{ template "podinfo.fullname" . }}
minReplicas: {{ .Values.replicaCount }}
maxReplicas: {{ .Values.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.hpa.cpu }}
- type: Resource
resource:
name: memory
targetAverageValue: {{ .Values.hpa.memory }}
{{- end }}
+6 -2
View File
@@ -1,6 +1,4 @@
# Default values for podinfo.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
@@ -15,6 +13,12 @@ service:
containerPort: 9898
nodePort: 31198
hpa:
enabled: false
maxReplicas: 10
cpu: 80
memory: 200Mi
ingress:
enabled: false
annotations: {}