ingress-nginx-helm/charts/ingress-nginx/templates/controller-hpa.yaml

46 lines
1.4 KiB
YAML
Raw Normal View History

2020-03-02 14:49:26 +00:00
{{- if and .Values.controller.autoscaling.enabled (or (eq .Values.controller.kind "Deployment") (eq .Values.controller.kind "Both")) -}}
{{- if not .Values.controller.keda.enabled }}
2020-06-11 22:34:31 +00:00
apiVersion: autoscaling/v2beta2
2020-02-24 19:25:57 +00:00
kind: HorizontalPodAutoscaler
metadata:
2021-06-02 09:52:24 +00:00
annotations:
{{- with .Values.controller.autoscaling.annotations }}
{{- toYaml . | trimSuffix "\n" | nindent 4 }}
{{- end }}
2020-02-24 19:25:57 +00:00
labels:
{{- include "ingress-nginx.labels" . | nindent 4 }}
app.kubernetes.io/component: controller
name: {{ include "ingress-nginx.controller.fullname" . }}
namespace: {{ .Release.Namespace }}
2020-02-24 19:25:57 +00:00
spec:
scaleTargetRef:
apiVersion: apps/v1
2020-02-24 19:25:57 +00:00
kind: Deployment
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:
2020-03-02 14:49:26 +00:00
{{- with .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
2020-06-11 22:34:31 +00:00
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ . }}
{{- end }}
{{- with .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ . }}
{{- end }}
2020-06-11 22:34:31 +00:00
{{- with .Values.controller.autoscalingTemplate }}
{{- toYaml . | nindent 2 }}
2020-03-02 14:49:26 +00:00
{{- end }}
2020-02-24 19:25:57 +00:00
{{- end }}
{{- end }}