2023-10-12 17:51:40 +00:00
|
|
|
{{- if and (eq .Values.controller.kind "Deployment") .Values.controller.autoscaling.enabled (not .Values.controller.keda.enabled) -}}
|
2023-05-11 16:37:03 +00:00
|
|
|
apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }}
|
2020-02-24 19:25:57 +00:00
|
|
|
kind: HorizontalPodAutoscaler
|
|
|
|
metadata:
|
2021-06-02 09:52:24 +00:00
|
|
|
{{- with .Values.controller.autoscaling.annotations }}
|
2023-05-11 16:37:03 +00:00
|
|
|
annotations: {{ toYaml . | nindent 4 }}
|
2021-06-02 09:52:24 +00:00
|
|
|
{{- end }}
|
2020-02-24 19:25:57 +00:00
|
|
|
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
|
2021-11-19 14:52:52 +00:00
|
|
|
{{- with .Values.controller.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2020-03-04 02:53:23 +00:00
|
|
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
2023-10-24 17:53:46 +00:00
|
|
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
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:
|
2023-06-05 15:07:27 +00:00
|
|
|
{{- with .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
|
2021-08-22 19:05:59 +00:00
|
|
|
- type: Resource
|
|
|
|
resource:
|
2023-06-05 15:07:27 +00:00
|
|
|
name: memory
|
2020-06-11 22:34:31 +00:00
|
|
|
target:
|
|
|
|
type: Utilization
|
|
|
|
averageUtilization: {{ . }}
|
|
|
|
{{- end }}
|
2023-06-05 15:07:27 +00:00
|
|
|
{{- with .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
|
2020-11-24 13:51:02 +00:00
|
|
|
- type: Resource
|
|
|
|
resource:
|
2023-06-05 15:07:27 +00:00
|
|
|
name: cpu
|
2020-11-24 13:51:02 +00:00
|
|
|
target:
|
|
|
|
type: Utilization
|
|
|
|
averageUtilization: {{ . }}
|
|
|
|
{{- end }}
|
2020-06-11 22:34:31 +00:00
|
|
|
{{- with .Values.controller.autoscalingTemplate }}
|
2021-08-22 19:05:59 +00:00
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.controller.autoscaling.behavior }}
|
|
|
|
behavior:
|
|
|
|
{{- toYaml . | nindent 4 }}
|
2020-03-02 14:49:26 +00:00
|
|
|
{{- end }}
|
2020-02-24 19:25:57 +00:00
|
|
|
{{- end }}
|