Files
charts/bitnami/spring-cloud-dataflow/templates/server/hpa.yaml
Miguel Ángel Cabrera Miñagorri 8b813f692c [bitnami/spring-cloud-dataflow] Use the new helper for HPA API version (#10213)
* Use the new helper for HPA API version

Signed-off-by: Miguel A. Cabrera Minagorri <devgorri@gmail.com>

* Contemplate targetAverageUtilization

Signed-off-by: Miguel A. Cabrera Minagorri <devgorri@gmail.com>

* Bump common and update HPA

Signed-off-by: Miguel A. Cabrera Minagorri <devgorri@gmail.com>

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

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

Co-authored-by: Bitnami Containers <containers@bitnami.com>
2022-05-24 11:26:43 +02:00

48 lines
1.9 KiB
YAML

{{- if .Values.server.autoscaling.enabled }}
apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "scdf.fullname" . }}-server
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: server
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
{{- 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 "scdf.fullname" . }}-server
minReplicas: {{ .Values.server.autoscaling.minReplicas }}
maxReplicas: {{ .Values.server.autoscaling.maxReplicas }}
metrics:
{{- if .Values.server.autoscaling.targetCPU }}
- type: Resource
resource:
name: cpu
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.server.autoscaling.targetCPU }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.server.autoscaling.targetCPU }}
{{- end }}
{{- end }}
{{- if .Values.server.autoscaling.targetMemory }}
- type: Resource
resource:
name: memory
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.server.autoscaling.targetMemory }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.server.autoscaling.targetMemory }}
{{- end }}
{{- end }}
{{- end }}