Skip to content

Commit 5338bbf

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

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 .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
@@ -250,3 +250,35 @@ serviceAccount:
250250
# If not set and create is true, `azureserviceoperator-default` would be used as a name
251251
name: ""
252252
annotations: {}
253+
254+
verticalPodAutoscaler:
255+
# If true creates a Vertical Pod Autoscaler.
256+
enabled: false
257+
258+
# Recommender responsible for generating recommendation for the object.
259+
# List should be empty (then the default recommender will generate the recommendation)
260+
# or contain exactly one recommender.
261+
recommenders: []
262+
# - name: custom-recommender-performance
263+
264+
# List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory
265+
controlledResources: []
266+
# Specifies which resource values should be controlled: RequestsOnly or RequestsAndLimits.
267+
controlledValues: RequestsAndLimits
268+
269+
# Define the max allowed resources for the pod
270+
maxAllowed: {}
271+
# cpu: 500m
272+
# memory: 512Mi
273+
# Define the min allowed resources for the pod
274+
minAllowed: {}
275+
# cpu: 200m
276+
# memory: 256Mi
277+
278+
updatePolicy:
279+
# Specifies minimal number of replicas which need to be alive for VPA Updater to attempt pod eviction
280+
minReplicas: 1
281+
282+
# Specifies whether recommended updates are applied when a Pod is started and whether recommended updates
283+
# are applied during the life of a Pod. Possible values are "Off", "Initial", "Recreate", and "Auto".
284+
updateMode: Auto

0 commit comments

Comments
 (0)