[stable/nginx-ingress] add HPA in case of Deployment (#2736)

This commit is contained in:
Fabián Sellés Rosa
2017-12-09 18:09:35 +01:00
committed by Reinhard Nägele
parent bbd3c4c0ea
commit f3e86bf589
3 changed files with 33 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: nginx-ingress
version: 0.8.15
version: 0.8.16
appVersion: 0.9.0-beta.15
description: An nginx Ingress controller that uses ConfigMap to store the nginx configuration.
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png
@@ -0,0 +1,26 @@
{{- if eq .Values.controller.kind "Deployment" }}
{{- if .Values.controller.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: "{{ .Values.controller.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "controller.fullname" . }}
spec:
scaleTargetRef:
apiVersion: apps/v1beta1
kind: Deployment
name: {{ template "controller.fullname" . }}
minReplicas: "{{ .Values.controller.autoscaling.minReplicas }}"
maxReplicas: "{{ .Values.controller.autoscaling.maxReplicas }}"
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: "{{ .Values.controller.autoscaling.targetAverageUtilization }}"
{{- end }}
{{- end }}
+6
View File
@@ -97,6 +97,12 @@ controller:
# cpu: 100m
# memory: 64Mi
autoscaling:
enabled: false
# minReplicas: 1
# maxReplicas: 11
# targetAverageUtilization: 50
## Override NGINX template
customTemplate:
configMapName: ""