mirror of
https://github.com/bitnami/charts.git
synced 2026-04-01 06:47:23 +08:00
52 lines
2.2 KiB
YAML
52 lines
2.2 KiB
YAML
{{- /*
|
|
Copyright Broadcom, Inc. All Rights Reserved.
|
|
SPDX-License-Identifier: APACHE-2.0
|
|
*/}}
|
|
|
|
{{- if .Values.queryNode.autoscaling.hpa.enabled }}
|
|
apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: {{ template "milvus.query-node.fullname" . }}
|
|
namespace: {{ include "common.names.namespace" . | quote }}
|
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
app.kubernetes.io/part-of: milvus
|
|
app.kubernetes.io/component: query-node
|
|
{{- if or .Values.commonAnnotations .Values.queryNode.autoscaling.hpa.annotations }}
|
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.queryNode.autoscaling.hpa.annotations .Values.commonAnnotations ) "context" . ) }}
|
|
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
|
|
kind: Deployment
|
|
name: {{ template "milvus.query-node.fullname" . }}
|
|
minReplicas: {{ .Values.queryNode.autoscaling.hpa.minReplicas }}
|
|
maxReplicas: {{ .Values.queryNode.autoscaling.hpa.maxReplicas }}
|
|
metrics:
|
|
{{- if .Values.queryNode.autoscaling.hpa.targetCPU }}
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
|
targetAverageUtilization: {{ .Values.queryNode.autoscaling.hpa.targetCPU }}
|
|
{{- else }}
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: {{ .Values.queryNode.autoscaling.hpa.targetCPU }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.queryNode.autoscaling.hpa.targetMemory }}
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
|
|
targetAverageUtilization: {{ .Values.queryNode.autoscaling.hpa.targetMemory }}
|
|
{{- else }}
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: {{ .Values.queryNode.autoscaling.hpa.targetMemory }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|