Skip to content

introduce EXCLUDE_NAMESPACE env variable to exclude namespaces from being watched#1837

Open
AndrewChubatiuk wants to merge 1 commit intomasterfrom
exclude-namespaces
Open

introduce EXCLUDE_NAMESPACE env variable to exclude namespaces from being watched#1837
AndrewChubatiuk wants to merge 1 commit intomasterfrom
exclude-namespaces

Conversation

@AndrewChubatiuk
Copy link
Contributor

@AndrewChubatiuk AndrewChubatiuk commented Feb 21, 2026

fixes #1289


Summary by cubic

Introduce EXCLUDE_NAMESPACE to let the operator ignore specific namespaces in cluster-wide mode. Enforced via the manager cache using DefaultFieldSelector; cannot be combined with WATCH_NAMESPACE.

  • New Features

    • EXCLUDE_NAMESPACE: comma-separated namespaces to exclude from watch.
    • Validation: mutually exclusive with WATCH_NAMESPACE; invalid names are rejected.
  • Refactors

    • Replaced ListObjectsByNamespace/NewObjectWatcherForNamespaces with ListObjects/NewObjectWatcher that read config internally.
    • Removed BaseConf and explicit watchNamespaces from controllers; updated reconcilers and the Prometheus converter to use new helpers.
    • Updated docs (env.md, CHANGELOG).

Written for commit c7fcff4. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 17 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/CHANGELOG.md">

<violation number="1" location="docs/CHANGELOG.md:31">
P2: The changelog entry incorrectly states EXCLUDE_NAMESPACE accepts a list of environment variables; it should describe a list of namespaces. This misdocuments the feature and can confuse users configuring it.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/CHANGELOG.md">

<violation number="1" location="docs/CHANGELOG.md:31">
P1: Custom agent: **Changelog Review Agent**

Changelog entry does not follow the required structure for user-centric explanation (before/after behavior and visible impact) as mandated by the Changelog Review Agent rule. Entries missing the required structure must be rejected.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

* FEATURE: [vmprobe](https://docs.victoriametrics.com/operator/resources/vmprobe/): added `spec.targets.kubernetes` property, that allows to configure probe for `ingress`, `pod` and `service` roles. See [#1078](https://github.com/VictoriaMetrics/operator/issues/1078) and [#1716](https://github.com/VictoriaMetrics/operator/issues/1716).
* FEATURE: [vmscrapeconfig](https://docs.victoriametrics.com/operator/resources/vmscrapeconfig/): added nomad_sd_config support. See [#1809](https://github.com/VictoriaMetrics/operator/issues/1809).
* FEATURE: [vmoperator](https://docs.victoriametrics.com/operator/): support VPA for vmcluster, vtcluster, vlcluster and vmauth. See [#1795](https://github.com/VictoriaMetrics/operator/issues/1795). Thanks to the @dctrwatson for the pull request [#1803](https://github.com/VictoriaMetrics/operator/pull/1803).
* FEATURE: [vmoperator](https://docs.victoriametrics.com/operator/): introduce `EXCLUDE_NAMESPACE` environment variable that accepts comma-separated list of namespaces that are excluded by operator. See [#1289](https://github.com/VictoriaMetrics/operator/issues/1289)
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Custom agent: Changelog Review Agent

Changelog entry does not follow the required structure for user-centric explanation (before/after behavior and visible impact) as mandated by the Changelog Review Agent rule. Entries missing the required structure must be rejected.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/CHANGELOG.md, line 31:

<comment>Changelog entry does not follow the required structure for user-centric explanation (before/after behavior and visible impact) as mandated by the Changelog Review Agent rule. Entries missing the required structure must be rejected.</comment>

<file context>
@@ -28,7 +28,7 @@ aliases:
 * FEATURE: [vmscrapeconfig](https://docs.victoriametrics.com/operator/resources/vmscrapeconfig/): added nomad_sd_config support. See [#1809](https://github.com/VictoriaMetrics/operator/issues/1809).
 * FEATURE: [vmoperator](https://docs.victoriametrics.com/operator/): support VPA for vmcluster, vtcluster, vlcluster and vmauth. See [#1795](https://github.com/VictoriaMetrics/operator/issues/1795). Thanks to the @dctrwatson for the pull request [#1803](https://github.com/VictoriaMetrics/operator/pull/1803).
-* FEATURE: [vmoperator](https://docs.victoriametrics.com/operator/): introduce `EXCLUDE_NAMESPACE` environment variable that accepts comma-separated list of environment variables that are excluded by operator. See [#1289](https://github.com/VictoriaMetrics/operator/issues/1289)
+* FEATURE: [vmoperator](https://docs.victoriametrics.com/operator/): introduce `EXCLUDE_NAMESPACE` environment variable that accepts comma-separated list of namespaces that are excluded by operator. See [#1289](https://github.com/VictoriaMetrics/operator/issues/1289)
 
 * BUGFIX: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/): previously the operator requested `nodes/proxy` RBAC permissions even though vmagent did not use them; now this permission is no longer required, reducing the default privilege footprint for users running vmagent. See [#1753](https://github.com/VictoriaMetrics/operator/issues/1753).
</file context>
Fix with Cubic

@AndrewChubatiuk AndrewChubatiuk force-pushed the exclude-namespaces branch 2 times, most recently from 21c214f to 9a62ddc Compare February 27, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: Ability to exclude specific namespaces from being watched by the operator.

1 participant