default-backend-hpa.yaml 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. {{- if and .Values.defaultBackend.enabled .Values.defaultBackend.autoscaling.enabled }}
  2. apiVersion: autoscaling/v2beta1
  3. kind: HorizontalPodAutoscaler
  4. metadata:
  5. labels:
  6. {{- include "ingress-nginx.labels" . | nindent 4 }}
  7. app.kubernetes.io/component: default-backend
  8. {{- with .Values.defaultBackend.labels }}
  9. {{- toYaml . | nindent 4 }}
  10. {{- end }}
  11. name: {{ template "ingress-nginx.defaultBackend.fullname" . }}
  12. namespace: {{ .Release.Namespace }}
  13. spec:
  14. scaleTargetRef:
  15. apiVersion: apps/v1
  16. kind: Deployment
  17. name: {{ template "ingress-nginx.defaultBackend.fullname" . }}
  18. minReplicas: {{ .Values.defaultBackend.autoscaling.minReplicas }}
  19. maxReplicas: {{ .Values.defaultBackend.autoscaling.maxReplicas }}
  20. metrics:
  21. {{- with .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }}
  22. - type: Resource
  23. resource:
  24. name: cpu
  25. targetAverageUtilization: {{ . }}
  26. {{- end }}
  27. {{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }}
  28. - type: Resource
  29. resource:
  30. name: memory
  31. targetAverageUtilization: {{ . }}
  32. {{- end }}
  33. {{- end }}