Files
devops-infra-helm-charts-gcp/helm-templates/mimir-distributed/templates/nginx/nginx-v2beta1-hpa.yaml
T
2026-08-26 03:39:42 +05:30

34 lines
1.1 KiB
YAML

{{- if not .Values.enterprise.enabled -}}
{{- if .Values.nginx.autoscaling.enabled }}
{{- if eq (include "mimir.hpa.version" .) "autoscaling/v2beta1" }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
labels:
{{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
minReplicas: {{ .Values.nginx.autoscaling.minReplicas }}
maxReplicas: {{ .Values.nginx.autoscaling.maxReplicas }}
metrics:
{{- with .Values.nginx.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ . }}
{{- end }}
{{- with .Values.nginx.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
{{- end -}}