From 36135488191dc6157aed7b9c46a9479b940dc166 Mon Sep 17 00:00:00 2001 From: Robert Fekete Date: Tue, 1 Aug 2023 15:25:18 +0200 Subject: [PATCH] Draft updates for watchNamespaceSelector Signed-off-by: Robert Fekete --- content/docs/logging-infrastructure/logging.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/content/docs/logging-infrastructure/logging.md b/content/docs/logging-infrastructure/logging.md index c972328b7..7e658e19c 100644 --- a/content/docs/logging-infrastructure/logging.md +++ b/content/docs/logging-infrastructure/logging.md @@ -9,7 +9,7 @@ The `logging` resource defines the logging infrastructure for your cluster that You can define multiple `logging` resources if needed, for example, if you want to run multiple Fluentd instances with separate configurations. -You can customize the configuration of Fluentd, syslog-ng, and Fluent Bit in the logging resource. It also declares `watchNamespaces` if applicable to narrow down the namespaces in which the logging operator should evaluate and incorporate `Flow` and `Output` resources into fluentd's configuration. +You can customize the configuration of Fluentd, syslog-ng, and Fluent Bit in the logging resource. The logging resource also declares `watchNamespaces`, that specifies the namespaces to include in the `Flow` and `Output` resources of Fluentd's configuration. {{< include-headless "note-helm-chart-logging-resource.md" >}} @@ -56,3 +56,19 @@ spec: controlNamespace: logging watchNamespaces: ["prod", "test"] ``` + +Starting with Logging operator version 4.3, you can use the `watchNamespaceSelector` selector to select the watched namespaces based on their label, or an expression, for example: + +```yaml + watchNamespaceSelector: + matchLabels: + : +``` + +```yaml + watchNamespaceSelector: + matchExpressions: + FIXME-ADD-AN-EXAMPLE +``` + +If you set both `watchNamespaces` and `watchNamespaceSelector`, both take effect, and the matching namespaces are added to a single list.