From b1f06488a53fe1732b793600fb04e945fb082348 Mon Sep 17 00:00:00 2001 From: Anson Liu Date: Fri, 8 Nov 2024 15:39:04 +1300 Subject: [PATCH] Add affinity support for fluent-operator deployment (#1401) * Add affinity to helm chart Signed-off-by: Anson Liu * Apply suggestions from code review Signed-off-by: Benjamin Huo --------- Signed-off-by: Anson Liu Signed-off-by: Benjamin Huo Co-authored-by: Benjamin Huo --- charts/fluent-operator/Chart.yaml | 2 +- .../fluent-operator/templates/fluent-operator-deployment.yaml | 4 ++++ charts/fluent-operator/values.yaml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/fluent-operator/Chart.yaml b/charts/fluent-operator/Chart.yaml index 2dce357ee..997d7e9d7 100644 --- a/charts/fluent-operator/Chart.yaml +++ b/charts/fluent-operator/Chart.yaml @@ -6,7 +6,7 @@ keywords: - fluent-bit - fluentd - operator -version: 3.2.0 +version: 3.2.1 appVersion: 3.2.0 icon: https://raw.githubusercontent.com/fluent/fluent-operator/master/docs/images/fluent-operator-icon.svg home: https://www.fluentd.org/ diff --git a/charts/fluent-operator/templates/fluent-operator-deployment.yaml b/charts/fluent-operator/templates/fluent-operator-deployment.yaml index ab6a27a84..1aa1cdb31 100644 --- a/charts/fluent-operator/templates/fluent-operator-deployment.yaml +++ b/charts/fluent-operator/templates/fluent-operator-deployment.yaml @@ -126,6 +126,10 @@ spec: nodeSelector: {{ toYaml .Values.operator.nodeSelector | nindent 8 }} {{- end }} + {{- if .Values.operator.affinity }} + affinity: + {{ toYaml .Values.operator.affinity | nindent 8 }} + {{- end }} {{- if .Values.operator.podSecurityContext }} securityContext: {{ toYaml .Values.operator.podSecurityContext | nindent 8 }} diff --git a/charts/fluent-operator/values.yaml b/charts/fluent-operator/values.yaml index 7be9eb0ca..82bd8bcf0 100644 --- a/charts/fluent-operator/values.yaml +++ b/charts/fluent-operator/values.yaml @@ -30,6 +30,8 @@ operator: enable: true # nodeSelector configuration for Fluent Operator. Ref: https://kubernetes.io/docs/user-guide/node-selection/ nodeSelector: {} + # affinity configuration for Fluent Operator. Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity + affinity: {} # Node tolerations applied to Fluent Operator. Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ tolerations: [] # Priority class applied to Fluent Operator. Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass