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

✨ Add RBAC files for metrics authentication and authorization #2116

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

kashifest
Copy link
Member

@kashifest kashifest commented Dec 11, 2024

#2102 has introduced controller-runtime's WithAuthenticationAndAuthorization filter which also requires extra RBAC roles and role bindings for metrics authentication and authorization. This PR adds those.

@metal3-io-bot metal3-io-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 11, 2024
@kashifest
Copy link
Member Author

kashifest commented Dec 11, 2024

@camilamacedo86 I could identify these RBACs. Please check if this is sufficient. Thanks for your feedback so far.

@metal3-io-bot metal3-io-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 12, 2024
@kashifest kashifest force-pushed the kashif/add-missing-rbac-metrics branch 11 times, most recently from e7b25b8 to c1e6906 Compare December 13, 2024 09:37
camilamacedo86

This comment was marked as outdated.

@metal3-io-bot
Copy link
Contributor

@camilamacedo86: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

/lgtm

That is great 🥇
Thank you.

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.

@kashifest kashifest force-pushed the kashif/add-missing-rbac-metrics branch 8 times, most recently from b7dfa2f to e8ad68c Compare December 15, 2024 17:53
Copy link
Member

@mquhuy mquhuy left a comment

Choose a reason for hiding this comment

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

Some nits.
I'm not sure about the reason of the failure, but it didn't happen to me in local env. Have you tried rebasing the PR?

test/e2e/e2e_suite_test.go Show resolved Hide resolved
test/e2e/e2e_suite_test.go Show resolved Hide resolved
test/e2e/e2e_suite_test.go Outdated Show resolved Hide resolved
test/e2e/e2e_suite_test.go Outdated Show resolved Hide resolved
test/e2e/e2e_suite_test.go Outdated Show resolved Hide resolved
@kashifest
Copy link
Member Author

Some nits. I'm not sure about the reason of the failure, but it didn't happen to me in local env. Have you tried rebasing the PR?

rebased but still failing.

Copy link
Member

@mquhuy mquhuy left a comment

Choose a reason for hiding this comment

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

I think I found the reason.

test/e2e/e2e_suite_test.go Outdated Show resolved Hide resolved
metal3-io#2102 has introduced controller-runtime's WithAuthenticationAndAuthorization filter which also requires extra RBAC roles and role bindings for metrics authentication and authorization. This PR adds those.

Signed-off-by: Kashif Khan <[email protected]>
@kashifest kashifest force-pushed the kashif/add-missing-rbac-metrics branch 3 times, most recently from 0617d17 to 47f2f52 Compare December 17, 2024 07:55
@tuminoid tuminoid added this to the BMO - v0.9 milestone Dec 17, 2024
@kashifest
Copy link
Member Author

/cc @lentzi90 @zaneb @dtantsur @elfosardo

@kashifest kashifest force-pushed the kashif/add-missing-rbac-metrics branch 3 times, most recently from 8ac0ee8 to 39f54e9 Compare December 17, 2024 10:55
@kashifest kashifest force-pushed the kashif/add-missing-rbac-metrics branch from 39f54e9 to a6c6a15 Compare December 17, 2024 11:50
Copy link
Member

@lentzi90 lentzi90 left a comment

Choose a reason for hiding this comment

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

/approve
Let's get this merged so we have a functioning metrics endpoint. Then we can improve on the e2e test later.

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, lentzi90

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

The pull request process is described here

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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 17, 2024
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 17, 2024
@metal3-io-bot metal3-io-bot merged commit 4c82478 into metal3-io:main Dec 17, 2024
16 checks passed
@metal3-io-bot metal3-io-bot deleted the kashif/add-missing-rbac-metrics branch December 17, 2024 15:11
@tuminoid
Copy link
Member

I put the backporting question to community meeting topic list tomorrow just to have concensus. It kinda feels right to backport, but also we might also get by using deprecated image for the time 0.8.

@camilamacedo86
Copy link

Hi @tuminoid

You can deprecate the old versions as well
But any version provided before with this image is risking not working when the image goes away.

@kashifest
Copy link
Member Author

/cherry-pick release-0.8

@metal3-io-bot
Copy link
Contributor

@kashifest: #2116 failed to apply on top of branch "release-0.8":

Applying: Add RBAC files for metrics authentication and authorization
Using index info to reconstruct a base tree...
M	config/render/capm3.yaml
Falling back to patching base and 3-way merge...
Auto-merging config/render/capm3.yaml
Applying: Add e2e test for metrics service
Using index info to reconstruct a base tree...
M	config/base/manager.yaml
M	config/render/capm3.yaml
M	main.go
M	test/e2e/e2e_suite_test.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/e2e_suite_test.go
Auto-merging main.go
Auto-merging config/render/capm3.yaml
Auto-merging config/base/manager.yaml
CONFLICT (content): Merge conflict in config/base/manager.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0002 Add e2e test for metrics service

In response to this:

/cherry-pick release-0.8

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
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: BMO WIP
Development

Successfully merging this pull request may close these issues.

6 participants