{{ if (.Values.vpa).enabled }} {{ if .Values.resources }} apiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: {{ include "chart.fullname" . }} namespace: {{ .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: resourcePolicy: containerPolicies: - containerName: manager controlledValues: RequestsAndLimits minAllowed: cpu: {{ .Values.resources.requests.cpu }} memory: {{ .Values.resources.requests.memory }} maxAllowed: cpu: {{ .Values.resources.limits.cpu }} memory: {{ .Values.resources.limits.memory }} mode: Auto targetRef: apiVersion: apps/v1 kind: Deployment name: {{ include "chart.fullname" . }} updatePolicy: updateMode: Auto {{- end }} {{- end }}