Skip to content

Commit

Permalink
feat(chart): add vpa support
Browse files Browse the repository at this point in the history
Signed-off-by: t3mi <t3mi@users.noreply.github.com>
  • Loading branch information
t3mi committed Feb 5, 2024
1 parent 7acf5b8 commit 670b67d
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1") (.Values.reloader.verticalPodAutoscaler.enabled) }}
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: {{ template "reloader-fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "reloader-labels.chart" . | nindent 4 }}
spec:
{{- with .Values.reloader.verticalPodAutoscaler.recommenders }}
recommenders:
{{- toYaml . | nindent 4 }}
{{- end }}
resourcePolicy:
containerPolicies:
- containerName: {{ template "reloader-fullname" . }}
{{- with .Values.reloader.verticalPodAutoscaler.controlledResources }}
controlledResources:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.reloader.verticalPodAutoscaler.controlledValues }}
controlledValues: {{ .Values.reloader.verticalPodAutoscaler.controlledValues }}
{{- end }}
{{- if .Values.reloader.verticalPodAutoscaler.maxAllowed }}
maxAllowed:
{{ toYaml .Values.reloader.verticalPodAutoscaler.maxAllowed | nindent 8 }}
{{- end }}
{{- if .Values.reloader.verticalPodAutoscaler.minAllowed }}
minAllowed:
{{ toYaml .Values.reloader.verticalPodAutoscaler.minAllowed | nindent 8 }}
{{- end }}
targetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "reloader-fullname" . }}
{{- with .Values.reloader.verticalPodAutoscaler.updatePolicy }}
updatePolicy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
33 changes: 32 additions & 1 deletion deployments/kubernetes/chart/reloader/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,38 @@ reloader:
# matchLabels:
# app.kubernetes.io/name: prometheus
to: []


# Enable vertical pod autoscaler
verticalPodAutoscaler:
enabled: false

# Recommender responsible for generating recommendation for the object.
# List should be empty (then the default recommender will generate the recommendation)
# or contain exactly one recommender.
# recommenders:
# - name: custom-recommender-performance

# List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory
controlledResources: []
# Specifies which resource values should be controlled: RequestsOnly or RequestsAndLimits.
# controlledValues: RequestsAndLimits

# Define the max allowed resources for the pod
maxAllowed: {}
# cpu: 200m
# memory: 100Mi
# Define the min allowed resources for the pod
minAllowed: {}
# cpu: 200m
# memory: 100Mi

updatePolicy:
# Specifies minimal number of replicas which need to be alive for VPA Updater to attempt pod eviction
# minReplicas: 1
# Specifies whether recommended updates are applied when a Pod is started and whether recommended updates
# are applied during the life of a Pod. Possible values are "Off", "Initial", "Recreate", and "Auto".
updateMode: Auto

volumeMounts: []

volumes: []
Expand Down

0 comments on commit 670b67d

Please sign in to comment.