Skip to content

Commit de9d432

Browse files
committed
feat(helm): add support for vpa
Signed-off-by: t3mi <t3mi@users.noreply.github.com>
1 parent aa86061 commit de9d432

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1") (.Values.verticalPodAutoscaler.enabled) }}
2+
apiVersion: autoscaling.k8s.io/v1
3+
kind: VerticalPodAutoscaler
4+
metadata:
5+
name: azureserviceoperator
6+
namespace: {{ .Release.Namespace }}
7+
spec:
8+
{{- with .Values.verticalPodAutoscaler.recommenders }}
9+
recommenders:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
resourcePolicy:
13+
containerPolicies:
14+
- containerName: manager
15+
{{- with .Values.verticalPodAutoscaler.controlledResources }}
16+
controlledResources:
17+
{{- toYaml . | nindent 8 }}
18+
{{- end }}
19+
{{- if .Values.verticalPodAutoscaler.controlledValues }}
20+
controlledValues: {{ .Values.verticalPodAutoscaler.controlledValues }}
21+
{{- end }}
22+
{{- if .Values.verticalPodAutoscaler.maxAllowed }}
23+
maxAllowed:
24+
{{- toYaml .Values.verticalPodAutoscaler.maxAllowed | nindent 8 }}
25+
{{- end }}
26+
{{- if .Values.verticalPodAutoscaler.minAllowed }}
27+
minAllowed:
28+
{{- toYaml .Values.verticalPodAutoscaler.minAllowed | nindent 8 }}
29+
{{- end }}
30+
targetRef:
31+
apiVersion: apps/v1
32+
kind: Deployment
33+
name: azureserviceoperator-controller-manager
34+
{{- with .Values.verticalPodAutoscaler.updatePolicy }}
35+
updatePolicy:
36+
{{- toYaml . | nindent 4 }}
37+
{{- end }}
38+
{{- end }}

v2/charts/azure-service-operator/values.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,35 @@ rateLimit:
200200
qps: 5
201201
# The size of the bucket. This value only has an effect if mode is 'bucket'.
202202
bucketSize: 100
203+
204+
verticalPodAutoscaler:
205+
# If true creates a Vertical Pod Autoscaler.
206+
enabled: false
207+
208+
# Recommender responsible for generating recommendation for the object.
209+
# List should be empty (then the default recommender will generate the recommendation)
210+
# or contain exactly one recommender.
211+
recommenders: []
212+
# - name: custom-recommender-performance
213+
214+
# List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory
215+
controlledResources: []
216+
# Specifies which resource values should be controlled: RequestsOnly or RequestsAndLimits.
217+
controlledValues: RequestsAndLimits
218+
219+
# Define the max allowed resources for the pod
220+
maxAllowed: {}
221+
# cpu: 500m
222+
# memory: 512Mi
223+
# Define the min allowed resources for the pod
224+
minAllowed: {}
225+
# cpu: 200m
226+
# memory: 256Mi
227+
228+
updatePolicy:
229+
# Specifies minimal number of replicas which need to be alive for VPA Updater to attempt pod eviction
230+
minReplicas: 1
231+
232+
# Specifies whether recommended updates are applied when a Pod is started and whether recommended updates
233+
# are applied during the life of a Pod. Possible values are "Off", "Initial", "Recreate", and "Auto".
234+
updateMode: Auto

0 commit comments

Comments
 (0)