Files
charts/bitnami/schema-registry/templates/hpa.yaml
Ettore Pelosato 590ad88e40 [bitnami/schema-registry] Added customPodMetrics option to trigge… (#20074)
* [bitnami/schema-registry] Added customPodMetrics option to trigger autoscaling

    Signed-off-by: etisreal <etpelosato2010@hotmail.it>

Signed-off-by: etisreal <etpelosato2010@hotmail.it>

* [bitnami/schema-registry] Added metadata for name and averageValue fields in README

Signed-off-by: etisreal <etpelosato2010@hotmail.it>

* [bitnami/schema-registry] Corrected README metadata and bumped down Chart version

Signed-off-by: etisreal <etpelosato2010@hotmail.it>

* [bitnami/schema-registry] Corrected Metadata for autoscaling.customPodMetrics

Signed-off-by: etisreal <etpelosato2010@hotmail.it>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

---------

Signed-off-by: etisreal <etpelosato2010@hotmail.it>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Signed-off-by: Ettore Pelosato <113307574+ETisREAL@users.noreply.github.com>
Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
2023-10-24 10:15:07 +02:00

51 lines
1.7 KiB
YAML

{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if .Values.autoscaling.enabled }}
apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
scaleTargetRef:
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
name: {{ include "common.names.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if not (empty .Values.autoscaling.customPodMetrics) }}
{{- range .Values.autoscaling.customPodMetrics }}
- type: Pods
pods:
metric:
name: {{ .name }}
target:
type: AverageValue
averageValue: {{ .averageValue }}
{{ end -}}
{{- end }}
{{- if .Values.autoscaling.targetCPU }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPU }}
{{- end }}
{{- if .Values.autoscaling.targetMemory }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemory }}
{{- end }}
{{- end }}