2020-11-04 13:03:50 +00:00
|
|
|
{{- if .Values.defaultBackend.autoscaling.enabled }}
|
|
|
|
apiVersion: autoscaling/v2beta1
|
|
|
|
kind: HorizontalPodAutoscaler
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
|
|
|
app.kubernetes.io/component: default-backend
|
2020-11-30 23:52:31 +00:00
|
|
|
name: {{ template "ingress-nginx.defaultBackend.fullname" . }}
|
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
|
2020-11-30 23:52:31 +00:00
|
|
|
name: {{ template "ingress-nginx.defaultBackend.fullname" . }}
|
2020-11-04 13:03:50 +00:00
|
|
|
minReplicas: {{ .Values.defaultBackend.autoscaling.minReplicas }}
|
|
|
|
maxReplicas: {{ .Values.defaultBackend.autoscaling.maxReplicas }}
|
|
|
|
metrics:
|
|
|
|
{{- with .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }}
|
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: cpu
|
|
|
|
targetAverageUtilization: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }}
|
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: memory
|
|
|
|
targetAverageUtilization: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|