Skip to content

Commit 920c5d2

Browse files
authoredMar 20, 2024··
Merge pull request #611 from t3mi/vpa
feat(chart): add vpa support
2 parents 0aa95c9 + 3a07584 commit 920c5d2

File tree

2 files changed

+72
-1
lines changed

2 files changed

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

‎deployments/kubernetes/chart/reloader/values.yaml

+32-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,38 @@ reloader:
280280
# matchLabels:
281281
# app.kubernetes.io/name: prometheus
282282
to: []
283-
283+
284+
# Enable vertical pod autoscaler
285+
verticalPodAutoscaler:
286+
enabled: false
287+
288+
# Recommender responsible for generating recommendation for the object.
289+
# List should be empty (then the default recommender will generate the recommendation)
290+
# or contain exactly one recommender.
291+
# recommenders:
292+
# - name: custom-recommender-performance
293+
294+
# List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory
295+
controlledResources: []
296+
# Specifies which resource values should be controlled: RequestsOnly or RequestsAndLimits.
297+
# controlledValues: RequestsAndLimits
298+
299+
# Define the max allowed resources for the pod
300+
maxAllowed: {}
301+
# cpu: 200m
302+
# memory: 100Mi
303+
# Define the min allowed resources for the pod
304+
minAllowed: {}
305+
# cpu: 200m
306+
# memory: 100Mi
307+
308+
updatePolicy:
309+
# Specifies minimal number of replicas which need to be alive for VPA Updater to attempt pod eviction
310+
# minReplicas: 1
311+
# Specifies whether recommended updates are applied when a Pod is started and whether recommended updates
312+
# are applied during the life of a Pod. Possible values are "Off", "Initial", "Recreate", and "Auto".
313+
updateMode: Auto
314+
284315
volumeMounts: []
285316

286317
volumes: []

0 commit comments

Comments
 (0)
Please sign in to comment.