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-11-18 20:22:34 +00:00
|
|
|
{{- if not .Values.controller.keda.enabled }}
|
|
|
|
|
2020-06-11 22:34:31 +00:00
|
|
|
apiVersion: autoscaling/v2beta2
|
2020-02-24 19:25:57 +00:00
|
|
|
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.targetMemoryUtilizationPercentage }}
|
2020-06-11 22:34:31 +00:00
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: memory
|
|
|
|
target:
|
|
|
|
type: Utilization
|
|
|
|
averageUtilization: {{ . }}
|
|
|
|
{{- end }}
|
2020-11-24 13:51:02 +00:00
|
|
|
{{- with .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
|
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: cpu
|
|
|
|
target:
|
|
|
|
type: Utilization
|
|
|
|
averageUtilization: {{ . }}
|
|
|
|
{{- end }}
|
2020-06-11 22:34:31 +00:00
|
|
|
{{- with .Values.controller.autoscalingTemplate }}
|
|
|
|
{{- toYaml . | nindent 2 }}
|
2020-03-02 14:49:26 +00:00
|
|
|
{{- end }}
|
2020-02-24 19:25:57 +00:00
|
|
|
{{- end }}
|
2020-11-18 20:22:34 +00:00
|
|
|
{{- end }}
|
|
|
|
|