2020-03-02 14:49:26 +00:00
|
|
|
{{- if and .Values.controller.autoscaling.enabled (or (eq .Values.controller.kind "Deployment") (eq .Values.controller.kind "Both")) -}}
|
2020-02-24 19:25:57 +00:00
|
|
|
apiVersion: autoscaling/v2beta1
|
|
|
|
kind: HorizontalPodAutoscaler
|
|
|
|
metadata:
|
|
|
|
labels:
|
2020-02-28 14:53:24 +00:00
|
|
|
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
2020-03-04 02:53:23 +00:00
|
|
|
app.kubernetes.io/component: controller
|
|
|
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
2020-02-24 19:25:57 +00:00
|
|
|
spec:
|
|
|
|
scaleTargetRef:
|
2020-04-06 23:01:52 +00:00
|
|
|
apiVersion: apps/v1
|
2020-02-24 19:25:57 +00:00
|
|
|
kind: Deployment
|
2020-03-04 02:53:23 +00:00
|
|
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
2020-02-24 19:25:57 +00:00
|
|
|
minReplicas: {{ .Values.controller.autoscaling.minReplicas }}
|
|
|
|
maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }}
|
|
|
|
metrics:
|
2020-03-02 14:49:26 +00:00
|
|
|
{{- with .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
|
2020-02-24 19:25:57 +00:00
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: cpu
|
|
|
|
targetAverageUtilization: {{ . }}
|
2020-03-02 14:49:26 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
|
2020-02-24 19:25:57 +00:00
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: memory
|
|
|
|
targetAverageUtilization: {{ . }}
|
2020-03-02 14:49:26 +00:00
|
|
|
{{- end }}
|
2020-02-24 19:25:57 +00:00
|
|
|
{{- end }}
|