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

48 lines
1.6 KiB
YAML
Raw Normal View History

{{- if and (eq .Values.controller.kind "Deployment") .Values.controller.autoscaling.enabled (not .Values.controller.keda.enabled) -}}
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 }}
annotations: {{ toYaml . | nindent 4 }}
2021-06-02 09:52:24 +00:00
{{- end }}
2020-02-24 19:25:57 +00:00
labels:
{{- include "ingress-nginx.labels" . | nindent 4 }}
app.kubernetes.io/component: controller
{{- with .Values.controller.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "ingress-nginx.controller.fullname" . }}
namespace: {{ include "ingress-nginx.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:
{{- with .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
2020-06-11 22:34:31 +00:00
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 }}
{{- 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 }}