Skip to content

Remove unnecessary pods RBAC permissions - #957

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
stuggi:rbac-cleanup-pods
Jul 28, 2026
Merged

Remove unnecessary pods RBAC permissions#957
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
stuggi:rbac-cleanup-pods

Conversation

@stuggi

@stuggi stuggi commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The workload rbacRules and kubebuilder RBAC markers granted the operator and its workload service account full CRUD (create/delete/get/list/patch/update/ watch) on core Pods, but the operator never reads or writes Pod objects directly — pods only ever come into being indirectly via Deployments/ StatefulSets/Jobs. Remove the unused pods permission and regenerate config/rbac/role.yaml.

@openshift-ci
openshift-ci Bot requested review from dprince and paramite July 24, 2026 14:09
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/deb0d3c3531643f496aaa1dad5e7c692

✔️ telemetry-openstack-meta-content-provider-master SUCCESS in 30m 33s
telemetry-operator-multinode-cloudkitty NODE_FAILURE Node(set) request 099-0000152102 failed in 0s
✔️ telemetry-openstack-meta-content-provider-all-services-master SUCCESS in 2h 14m 08s
telemetry-operator-multinode-master FAILURE in 1h 27m 58s
openstack-k8s-operators-content-provider FAILURE in 13m 44s
⚠️ telemetry-operator-multinode-default-telemetry SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
functional-tests-osp18 NODE_FAILURE Node(set) request 099-0000152103 failed in 0s

@abays abays left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the lgtm label Jul 24, 2026
@stuggi

stuggi commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@stuggi

stuggi commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/410c7ec03d284c519bf91591cd9868c0

✔️ telemetry-openstack-meta-content-provider-master SUCCESS in 2h 51m 10s
✔️ telemetry-operator-multinode-cloudkitty SUCCESS in 1h 35m 57s
✔️ telemetry-openstack-meta-content-provider-all-services-master SUCCESS in 2h 27m 30s
✔️ telemetry-operator-multinode-master SUCCESS in 1h 35m 04s
✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 59m 52s
✔️ telemetry-operator-multinode-default-telemetry SUCCESS in 1h 41m 42s
functional-tests-osp18 FAILURE in 2h 20m 45s

@stuggi

stuggi commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/27156e8290744b6193c93569dab3c1b2

✔️ telemetry-openstack-meta-content-provider-master SUCCESS in 3h 15m 19s
✔️ telemetry-operator-multinode-cloudkitty SUCCESS in 1h 50m 00s
✔️ telemetry-openstack-meta-content-provider-all-services-master SUCCESS in 2h 45m 18s
✔️ telemetry-operator-multinode-master SUCCESS in 1h 50m 43s
✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 07m 07s
✔️ telemetry-operator-multinode-default-telemetry SUCCESS in 1h 39m 28s
functional-tests-osp18 FAILURE in 2h 25m 36s

The workload rbacRules and kubebuilder RBAC markers granted the
operator and its workload service accounts full CRUD (create/delete/
get/list/patch/update/watch) on core Pods. Most of these components
never read or write Pod objects directly, so the unused grants are
removed.

Two exceptions are kept, scoped down to what is actually used:

- Ceilometer deploys a kube-state-metrics StatefulSet running as its
  workload service account, which genuinely needs get;list;watch on
  Pods to produce kube_pod_status_* metrics. Keep that rbacRules grant
  (scoped to get;list;watch, dropping the unused write verbs), and add
  the matching kubebuilder marker so the controller-manager's own
  ClusterRole retains the permissions it needs to grant that Role.
- CloudKittyAPI and CloudKittyProc call lib-common's
  VerifyNetworkStatusFromAnnotation to verify NetworkAttachments,
  which lists Pods using the controller-manager's own client. Keep the
  get;list kubebuilder markers on both.

Regenerate config/rbac/role.yaml.

Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
@stuggi
stuggi force-pushed the rbac-cleanup-pods branch from 91a7cb6 to 14250d0 Compare July 27, 2026 07:29
@openshift-ci openshift-ci Bot removed the lgtm label Jul 27, 2026
@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@stuggi

stuggi commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@abays abays added the lgtm label Jul 27, 2026
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/c1a4eb7344d2419892775988b1f77326

✔️ telemetry-openstack-meta-content-provider-master SUCCESS in 4h 23m 10s
✔️ telemetry-operator-multinode-cloudkitty SUCCESS in 1h 43m 33s
✔️ telemetry-openstack-meta-content-provider-all-services-master SUCCESS in 5h 27m 40s
✔️ telemetry-operator-multinode-master SUCCESS in 1h 42m 57s
openstack-k8s-operators-content-provider FAILURE in 11m 47s
⚠️ telemetry-operator-multinode-default-telemetry SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ functional-tests-osp18 SUCCESS in 2h 24m 33s

@stuggi

stuggi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@openshift-merge-bot
openshift-merge-bot Bot merged commit cfb8329 into openstack-k8s-operators:main Jul 28, 2026
7 checks passed
@stuggi

stuggi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

/cherry-pick 18-stable

@openshift-cherrypick-robot

Copy link
Copy Markdown

@stuggi: new pull request created: #968

Details

In response to this:

/cherry-pick 18-stable

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants