{{- if .Values.vpa.enabled}}
apiVersion: "autoscaling.k8s.io/v1beta2"
kind: VerticalPodAutoscaler
metadata:
  name: gardener-extension-shoot-fleet-agent-vpa
  namespace: {{ .Release.Namespace }}
spec:
  {{- if .Values.vpa.resourcePolicy }}
  resourcePolicy:
    containerPolicies:
      - containerName: '*'
        minAllowed:
          cpu: {{ required ".Values.vpa.resourcePolicy.minAllowed.cpu is required" .Values.vpa.resourcePolicy.minAllowed.cpu }}
          memory: {{ required ".Values.vpa.resourcePolicy.minAllowed.memory is required" .Values.vpa.resourcePolicy.minAllowed.memory }}
  {{- end }}
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: gardener-extension-shoot-fleet-agent
  updatePolicy:
    updateMode: {{ .Values.vpa.updatePolicy.updateMode }}
{{- end }}