2023-10-12 18:51:40 +01:00
|
|
|
{{- if and (eq .Values.controller.kind "Deployment") .Values.controller.autoscaling.enabled (not .Values.controller.keda.enabled) -}}
|
2023-05-11 18:37:03 +02:00
|
|
|
apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }}
|
2020-02-24 16:25:57 -03:00
|
|
|
kind: HorizontalPodAutoscaler
|
|
|
|
|
metadata:
|
2021-06-02 11:52:24 +02:00
|
|
|
{{- with .Values.controller.autoscaling.annotations }}
|
2023-05-11 18:37:03 +02:00
|
|
|
annotations: {{ toYaml . | nindent 4 }}
|
2021-06-02 11:52:24 +02:00
|
|
|
{{- end }}
|
2020-02-24 16:25:57 -03:00
|
|
|
labels:
|
2020-02-28 08:53:24 -06:00
|
|
|
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
2020-03-03 21:53:23 -05:00
|
|
|
app.kubernetes.io/component: controller
|
2021-11-19 15:52:52 +01:00
|
|
|
{{- with .Values.controller.labels }}
|
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
|
{{- end }}
|
2020-03-03 21:53:23 -05:00
|
|
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
2023-10-25 01:53:46 +08:00
|
|
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
2020-02-24 16:25:57 -03:00
|
|
|
spec:
|
|
|
|
|
scaleTargetRef:
|
2020-04-06 19:01:52 -04:00
|
|
|
apiVersion: apps/v1
|
2020-02-24 16:25:57 -03:00
|
|
|
kind: Deployment
|
2020-03-03 21:53:23 -05:00
|
|
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
2020-02-24 16:25:57 -03:00
|
|
|
minReplicas: {{ .Values.controller.autoscaling.minReplicas }}
|
|
|
|
|
maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }}
|
|
|
|
|
metrics:
|
2023-06-05 20:37:27 +05:30
|
|
|
{{- with .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
|
2021-08-22 22:05:59 +03:00
|
|
|
- type: Resource
|
|
|
|
|
resource:
|
2023-06-05 20:37:27 +05:30
|
|
|
name: memory
|
2020-06-11 18:34:31 -04:00
|
|
|
target:
|
|
|
|
|
type: Utilization
|
|
|
|
|
averageUtilization: {{ . }}
|
|
|
|
|
{{- end }}
|
2023-06-05 20:37:27 +05:30
|
|
|
{{- with .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
|
2020-11-24 08:51:02 -05:00
|
|
|
- type: Resource
|
|
|
|
|
resource:
|
2023-06-05 20:37:27 +05:30
|
|
|
name: cpu
|
2020-11-24 08:51:02 -05:00
|
|
|
target:
|
|
|
|
|
type: Utilization
|
|
|
|
|
averageUtilization: {{ . }}
|
|
|
|
|
{{- end }}
|
2020-06-11 18:34:31 -04:00
|
|
|
{{- with .Values.controller.autoscalingTemplate }}
|
2021-08-22 22:05:59 +03:00
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- with .Values.controller.autoscaling.behavior }}
|
|
|
|
|
behavior:
|
|
|
|
|
{{- toYaml . | nindent 4 }}
|
2020-03-02 08:49:26 -06:00
|
|
|
{{- end }}
|
2020-02-24 16:25:57 -03:00
|
|
|
{{- end }}
|