Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate fluentbitagent toleartions #5061

Open
wants to merge 4 commits into
base: dev-v2.11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/rancher-logging/rancher-logging-106.0.0-rc.1+up4.10.0.tgz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ spec:
Skip_Long_Lines: {{ .Values.fluentbit.inputTail.Skip_Long_Lines | toString | quote }}
{{- end }}
{{- end }}
{{- with (concat (.Values.tolerations) (.Values.fluentbit.tolerations)) }}
tolerations: {{- toYaml . | nindent 6 }}
{{- end }}
tolerations: {{- include "customTolerations" . | nindent 6 }}
{{- with .Values.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 6 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,24 @@ true
{{- (include "windowsPathPrefix" .) | replace "C:" "" -}}
{{- end -}}

{{/*
Set tolerations based on Kubernetes distribution and merge with values.yaml
*/}}
{{- define "customTolerations" -}}
{{- $isRKE := .Values.additionalLoggingSources.rke.enabled -}}
{{- $defaultTolerations := list -}}
{{- if $isRKE }}
{{- $defaultTolerations = append $defaultTolerations (dict "key" "node-role.kubernetes.io/controlplane" "value" "true" "effect" "NoSchedule") -}}
{{- else }}
{{- $defaultTolerations = append $defaultTolerations (dict "key" "node-role.kubernetes.io/control-plane" "value" "true" "effect" "NoSchedule") -}}
{{- end }}
{{- $defaultTolerations = append $defaultTolerations (dict "key" "node-role.kubernetes.io/etcd" "value" "true" "effect" "NoExecute") -}}
{{- $userTolerations := .Values.tolerations | default list -}}
{{- $fluentbitTolerations := .Values.fluentbit.tolerations | default list -}}
{{- $mergedTolerations := concat $defaultTolerations $userTolerations $fluentbitTolerations -}}
{{- toYaml $mergedTolerations }}
{{- end -}}

{{/*
Set the controlplane selector based on kubernetes distribution
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ spec:
Tag: {{ .Values.additionalLoggingSources.kubeAudit.fluentbit.logTag }}
Path: /kube-audit-logs/{{ template "kubeAuditFilename" . }}
Parser: json
{{- with (concat (.Values.tolerations) (.Values.fluentbit.tolerations) (.Values.additionalLoggingSources.kubeAudit.fluentbit.tolerations)) }}
tolerations: {{- toYaml . | nindent 6 }}
{{- end }}
tolerations:
{{- include "customTolerations" . | nindent 6 }}
{{- with .Values.additionalLoggingSources.kubeAudit.fluentbit.tolerations }}
{{- toYaml . | nindent 6 }}
{{- end }}
nodeSelector: {{ include "controlplaneSelector" . | nindent 6 }}
{{- include "logging-operator.individualFluentbit" $individualValues | nindent 2 }}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ spec:
configMap:
name: "{{ .Release.Name }}-rke"
serviceAccountName: "{{ .Release.Name }}-rke-aggregator"
{{- $total_tolerations := concat (.Values.tolerations) (.Values.fluentbit.tolerations) }}
{{- with $total_tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
tolerations: {{- include "customTolerations" . | nindent 8 }}
{{- with .Values.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
16 changes: 2 additions & 14 deletions charts/rancher-logging/106.0.0-rc.1+up4.10.0/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,7 @@ additionalLoggingSources:
pathPrefix: ""
fluentbit:
logTag: kube-audit
tolerations:
- key: node-role.kubernetes.io/control-plane
value: "true"
effect: NoSchedule
- key: node-role.kubernetes.io/etcd
value: "true"
effect: NoExecute
tolerations: []

# configures node agent options for windows node agents
nodeAgents:
Expand Down Expand Up @@ -458,13 +452,7 @@ fluentbit:
Multiline_Flush: ""
Skip_Long_Lines: ""
resources: {}
tolerations:
- key: node-role.kubernetes.io/control-plane
value: "true"
effect: NoSchedule
- key: node-role.kubernetes.io/etcd
value: "true"
effect: NoExecute
tolerations: []
filterKubernetes:
Merge_Log: ""
Merge_Log_Key: ""
Expand Down
4 changes: 2 additions & 2 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14847,9 +14847,9 @@ entries:
catalog.cattle.io/upstream-version: 4.10.0
apiVersion: v2
appVersion: 4.10.0
created: "2025-01-31T19:23:27.399296+05:30"
created: "2025-02-04T11:11:32.641527849+05:30"
description: Logging operator for Kubernetes based on Fluentd and Fluentbit.
digest: 8e73d37d4854b3062bb0a2bd700180c6d47f2bfa7627f0b5d2bab6d6be225fd7
digest: c9526456fe731e557fb55767d0e54acbe76a7ab93d91792bf5556152faf9c67b
home: https://kube-logging.github.io
icon: file://assets/logos/rancher-logging.svg
keywords:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ spec:
Skip_Long_Lines: {{ .Values.fluentbit.inputTail.Skip_Long_Lines | toString | quote }}
{{- end }}
{{- end }}
{{- with (concat (.Values.tolerations) (.Values.fluentbit.tolerations)) }}
tolerations: {{- toYaml . | nindent 6 }}
{{- end }}
tolerations: {{- include "customTolerations" . | nindent 6 }}
{{- with .Values.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 6 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ spec:
Tag: {{ .Values.additionalLoggingSources.kubeAudit.fluentbit.logTag }}
Path: /kube-audit-logs/{{ template "kubeAuditFilename" . }}
Parser: json
{{- with (concat (.Values.tolerations) (.Values.fluentbit.tolerations) (.Values.additionalLoggingSources.kubeAudit.fluentbit.tolerations)) }}
tolerations: {{- toYaml . | nindent 6 }}
{{- end }}
tolerations:
{{- include "customTolerations" . | nindent 6 }}
{{- with .Values.additionalLoggingSources.kubeAudit.fluentbit.tolerations }}
{{- toYaml . | nindent 6 }}
{{- end }}
nodeSelector: {{ include "controlplaneSelector" . | nindent 6 }}
{{- include "logging-operator.individualFluentbit" $individualValues | nindent 2 }}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ spec:
configMap:
name: "{{ .Release.Name }}-rke"
serviceAccountName: "{{ .Release.Name }}-rke-aggregator"
{{- $total_tolerations := concat (.Values.tolerations) (.Values.fluentbit.tolerations) }}
{{- with $total_tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
tolerations: {{- include "customTolerations" . | nindent 8 }}
{{- with .Values.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- charts-original/templates/_helpers.tpl
+++ charts/templates/_helpers.tpl
@@ -64,6 +64,127 @@
@@ -64,6 +64,145 @@
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

Expand Down Expand Up @@ -35,6 +35,24 @@
+{{- end -}}
+
+{{/*
+Set tolerations based on Kubernetes distribution and merge with values.yaml
+*/}}
+{{- define "customTolerations" -}}
+{{- $isRKE := .Values.additionalLoggingSources.rke.enabled -}}
+{{- $defaultTolerations := list -}}
+{{- if $isRKE }}
+ {{- $defaultTolerations = append $defaultTolerations (dict "key" "node-role.kubernetes.io/controlplane" "value" "true" "effect" "NoSchedule") -}}
+{{- else }}
+ {{- $defaultTolerations = append $defaultTolerations (dict "key" "node-role.kubernetes.io/control-plane" "value" "true" "effect" "NoSchedule") -}}
+{{- end }}
+{{- $defaultTolerations = append $defaultTolerations (dict "key" "node-role.kubernetes.io/etcd" "value" "true" "effect" "NoExecute") -}}
+{{- $userTolerations := .Values.tolerations | default list -}}
+{{- $fluentbitTolerations := .Values.fluentbit.tolerations | default list -}}
+{{- $mergedTolerations := concat $defaultTolerations $userTolerations $fluentbitTolerations -}}
+{{- toYaml $mergedTolerations }}
+{{- end -}}
+
+{{/*
+Set the controlplane selector based on kubernetes distribution
+*/}}
+{{- define "controlplaneSelector" -}}
Expand Down Expand Up @@ -128,7 +146,7 @@
{{/*
Formats the cluster domain as a suffix, e.g.:
.Values.clusterDomain == "", returns ""
@@ -74,3 +195,37 @@
@@ -74,3 +213,37 @@
{{- printf ".%s" .Values.clusterDomain -}}
{{- end -}}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# -- storage class for event tailer pvc
accessModes:
- ReadWriteOnce
@@ -309,14 +304,176 @@
@@ -309,14 +304,164 @@
image: fluent/fluent-bit
pullPolicy: IfNotPresent
port: 8080
Expand Down Expand Up @@ -163,13 +163,7 @@
+ pathPrefix: ""
+ fluentbit:
+ logTag: kube-audit
+ tolerations:
+ - key: node-role.kubernetes.io/control-plane
+ value: "true"
+ effect: NoSchedule
+ - key: node-role.kubernetes.io/etcd
+ value: "true"
+ effect: NoExecute
+ tolerations: []
+
+# configures node agent options for windows node agents
+nodeAgents:
Expand Down Expand Up @@ -202,13 +196,7 @@
+ Multiline_Flush: ""
+ Skip_Long_Lines: ""
+ resources: {}
+ tolerations:
+ - key: node-role.kubernetes.io/control-plane
+ value: "true"
+ effect: NoSchedule
+ - key: node-role.kubernetes.io/etcd
+ value: "true"
+ effect: NoExecute
+ tolerations: []
+ filterKubernetes:
+ Merge_Log: ""
+ Merge_Log_Key: ""
Expand All @@ -221,7 +209,7 @@

# -- Extra manifests to deploy as an array
extraManifests: []
@@ -327,3 +484,12 @@
@@ -327,3 +472,12 @@
# name: extra-manifest
# data:
# extra-data: "value"
Expand Down