{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1/VerticalPodAutoscaler") .Values.frontend.autoscaling.vpa.enabled }} apiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: {{ include "shuffle.frontend.name" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "shuffle.frontend.labels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if or .Values.frontend.autoscaling.vpa.annotations .Values.commonAnnotations }} {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.frontend.autoscaling.vpa.annotations .Values.commonAnnotations ) "context" . ) }} annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: resourcePolicy: containerPolicies: - containerName: frontend {{- with .Values.frontend.autoscaling.vpa.controlledResources }} controlledResources: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.frontend.autoscaling.vpa.maxAllowed }} maxAllowed: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.frontend.autoscaling.vpa.minAllowed }} minAllowed: {{- toYaml . | nindent 8 }} {{- end }} targetRef: apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} kind: Deployment name: {{ include "frontend.names.name" . }} {{- if .Values.frontend.autoscaling.vpa.updatePolicy }} updatePolicy: {{- with .Values.frontend.autoscaling.vpa.updatePolicy.updateMode }} updateMode: {{ . }} {{- end }} {{- end }} {{- end }}