Skip to content

feat: conditionally watch node resources - #10135

Open
maxlengdell wants to merge 3 commits into
cloudnative-pg:mainfrom
maxlengdell:dev/9346-1
Open

maxlengdell wants to merge 3 commits into
cloudnative-pg:mainfrom
maxlengdell:dev/9346-1

Conversation

@maxlengdell

@maxlengdell maxlengdell commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

CNPG currently relies on access to cluster nodes. This PR introduces the possibility to opt out of this dependency by not watching for node events or invoking the k8 api to request node info.

This PR also introduces a new utils package for configuring the RBAC for the operator at runtime. This is used to split the default cluster role policies into role and cluster role. This intends to mimic a deployment of the operator where the operator and operand are deployed in the same namespace. This package also has the possibility to remove some resources from the rbac policies, such as nodes

Note
This is a modification & split out of #9350

Fixes #9346

Signed-off-by: Max Lengdell [email protected]

@maxlengdell
maxlengdell requested a review from a team March 4, 2026 16:35
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Mar 4, 2026
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.28 labels Mar 4, 2026
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@dosubot dosubot Bot added the enhancement 🪄 New feature or request label Mar 4, 2026
Comment thread docs/src/security.md Resolved
Comment thread docs/src/e2e.md Resolved
Comment thread docs/src/security.md Resolved
Comment thread docs/src/security.md Resolved
Comment thread docs/src/security.md Resolved
Comment thread docs/src/security.md Resolved
@maxlengdell

Copy link
Copy Markdown
Contributor Author

Thank you for the review @sxd , I added a commit with updates. I force pushed to resolve the DCO issue :)

CNPG currently relies on access to cluster nodes. This PR introduces the
possibility to opt out of this dependency by not watching for node
events or invoking the k8 api to request node info.

This PR also introduces a new utils package for configuring the RBAC for
the operator at runtime. This is used to split the default cluster role
policies into role and cluster role. This intends to mimic a deployment
of the operator where the operator and operand are deployed in the same
namespace. This package also has the possibility to remove some
resources from the rbac policies, such as nodes

Feature request: cloudnative-pg#9346

Signed-off-by: Max Lengdell <[email protected]>
Update documentation with more details on RBAC considerations for the
operator

Signed-off-by: Max Lengdell <[email protected]>
Fix minor details in the namespaced package.

Signed-off-by: Max Lengdell <[email protected]>
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases enhancement 🪄 New feature or request release-1.28 release-1.30 size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: CNPG operator should not crash when nodes & clusterimagecatalog resource access not permitted

4 participants