Skip to content

Commit

Permalink
[FEAT] adding vpa support (#308)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Takashi <[email protected]>

Signed-off-by: Nicolas Takashi <[email protected]>
  • Loading branch information
nicolastakashi authored Jan 20, 2023
1 parent c469f83 commit 1b148fe
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 3 deletions.
6 changes: 3 additions & 3 deletions charts/fluent-bit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords:
- logging
- fluent-bit
- fluentd
version: 0.21.7
version: 0.22.0
appVersion: 2.0.8
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/fluentd/fluentbit/icon/fluentbit-icon-color.svg
home: https://fluentbit.io/
Expand All @@ -22,5 +22,5 @@ maintainers:
email: [email protected]
annotations:
artifacthub.io/changes: |
- kind: changed
description: "Update fluent-bit image to 2.0.8"
- kind: added
description: "Added support for using the Vertical Pod Autoscaler (VPA) to recommend or modify pod resources."
38 changes: 38 additions & 0 deletions charts/fluent-bit/templates/vpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1/VerticalPodAutoscaler") .Values.autoscaling.vpa.enabled }}
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: {{ include "fluent-bit.fullname" . }}
labels:
{{- include "fluent-bit.labels" . | nindent 4 }}
{{- with .Values.autoscaling.vpa.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
resourcePolicy:
containerPolicies:
- containerName: {{ .Chart.Name }}
{{- with .Values.autoscaling.vpa.controlledResources }}
controlledResources:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.autoscaling.vpa.maxAllowed }}
maxAllowed:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.autoscaling.vpa.minAllowed }}
minAllowed:
{{- toYaml . | nindent 8 }}
{{- end }}
targetRef:
apiVersion: apps/v1
kind: {{ .Values.kind }}
name: {{ include "fluent-bit.fullname" . }}
{{- if .Values.autoscaling.vpa.updatePolicy }}
updatePolicy:
{{- with .Values.autoscaling.vpa.updatePolicy.updateMode }}
updateMode: {{ . }}
{{- end }}
{{- end }}
{{- end }}
22 changes: 22 additions & 0 deletions charts/fluent-bit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,28 @@ ingress:

## only available if kind is Deployment
autoscaling:
vpa:
enabled: false

annotations: {}

# List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory
controlledResources: []

# 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 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

enabled: false
minReplicas: 1
maxReplicas: 3
Expand Down

0 comments on commit 1b148fe

Please sign in to comment.