2021-01-07 23:31:30 +00:00
|
|
|
{{- if and .Values.defaultBackend.enabled .Values.defaultBackend.autoscaling.enabled }}
|
2023-05-11 16:37:03 +00:00
|
|
|
apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }}
|
2020-11-04 13:03:50 +00:00
|
|
|
kind: HorizontalPodAutoscaler
|
|
|
|
metadata:
|
2023-05-11 16:37:03 +00:00
|
|
|
{{- with .Values.defaultBackend.autoscaling.annotations }}
|
|
|
|
annotations: {{ toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2020-11-04 13:03:50 +00:00
|
|
|
labels:
|
|
|
|
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
|
|
|
app.kubernetes.io/component: default-backend
|
2021-11-19 14:52:52 +00:00
|
|
|
{{- with .Values.defaultBackend.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2023-05-11 16:37:03 +00:00
|
|
|
name: {{ include "ingress-nginx.defaultBackend.fullname" . }}
|
2021-06-21 11:56:51 +00:00
|
|
|
namespace: {{ .Release.Namespace }}
|
2020-11-04 13:03:50 +00:00
|
|
|
spec:
|
|
|
|
scaleTargetRef:
|
2020-11-30 23:52:31 +00:00
|
|
|
apiVersion: apps/v1
|
2020-11-04 13:03:50 +00:00
|
|
|
kind: Deployment
|
2023-05-11 16:37:03 +00:00
|
|
|
name: {{ include "ingress-nginx.defaultBackend.fullname" . }}
|
2020-11-04 13:03:50 +00:00
|
|
|
minReplicas: {{ .Values.defaultBackend.autoscaling.minReplicas }}
|
|
|
|
maxReplicas: {{ .Values.defaultBackend.autoscaling.maxReplicas }}
|
|
|
|
metrics:
|
2023-05-11 16:37:03 +00:00
|
|
|
{{- with .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }}
|
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: cpu
|
|
|
|
target:
|
|
|
|
type: Utilization
|
|
|
|
averageUtilization: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }}
|
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: memory
|
|
|
|
target:
|
|
|
|
type: Utilization
|
|
|
|
averageUtilization: {{ . }}
|
|
|
|
{{- end }}
|
2020-11-04 13:03:50 +00:00
|
|
|
{{- end }}
|