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

✨ Remove kube-rbac-proxy and use controller run-time provided WithAuthenticationAndAuthorization filter instead #2102

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

kashifest
Copy link
Member

@kashifest kashifest commented Dec 5, 2024

❗ Following resources have been removed as part of this PR:

  • ClusterRole: baremetal-operator-metrics-reader
  • ClusterRole: baremetal-operator-proxy-role
  • ClusterRoleBinding: baremetal-operator-proxy-rolebinding
  • Service: baremetal-operator-controller-manager-metrics-service

Short description: kube-rbac-proxy was historically used to protect the metrics endpoint. However, its usage has been discontinued in Kubebuilder. The default scaffold now leverages the WithAuthenticationAndAuthorization feature provided by Controller-Runtime. This change is trigerred from the fact that the image gcr.io/kubebuilder/kube-rbac-proxy is deprecated and will become unavailable sometime from early 2025.

Fixes: #2091

…er instead

Short description: kube-rbac-proxy was historically used to protect the metrics endpoint. However, its usage has been discontinued in Kubebuilder. The default scaffold now leverages the WithAuthenticationAndAuthorization feature provided by Controller-Runtime. This change is trigerred from the fact that the image gcr.io/kubebuilder/kube-rbac-proxy is deprecated and will become unavailable sometime from early 2025.
Fixes: metal3-io#2091

Signed-off-by: Kashif Khan <kashif.khan@est.tech>
@metal3-io-bot metal3-io-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 5, 2024
@kashifest kashifest changed the title 🌱 Remove kube-rbac-proxy and use controller run-time provided auth WithAuthenticationAndAuthorization instead 🌱 Remove kube-rbac-proxy and use controller run-time provided WithAuthenticationAndAuthorization filter instead Dec 5, 2024
@kashifest
Copy link
Member Author

/cc @zaneb @honza @lentzi90 @Rozzii

@elfosardo
Copy link
Member

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2024
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

For the release notes, I think we should document clearly the resources that have been deleted. Some users may use systems that automatically prune but others may need to do it manually. The resources are:

  • ClusterRole: baremetal-operator-metrics-reader
  • ClusterRole: baremetal-operator-proxy-role
  • ClusterRoleBinding: baremetal-operator-proxy-rolebinding
  • Service: baremetal-operator-controller-manager-metrics-service

/hold
Please add this to the description so it is picked up in the release notes. I wonder if we should also mark it as ✨

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 9, 2024
@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 9, 2024
@kashifest kashifest changed the title 🌱 Remove kube-rbac-proxy and use controller run-time provided WithAuthenticationAndAuthorization filter instead ✨ Remove kube-rbac-proxy and use controller run-time provided WithAuthenticationAndAuthorization filter instead Dec 9, 2024
@kashifest
Copy link
Member Author

/hold Please add this to the description so it is picked up in the release notes. I wonder if we should also mark it as ✨

Done

@tuminoid
Copy link
Member

tuminoid commented Dec 9, 2024

Unhold?

@lentzi90
Copy link
Member

lentzi90 commented Dec 9, 2024

/hold cancel

@metal3-io-bot metal3-io-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 9, 2024
@metal3-io-bot metal3-io-bot merged commit a1a9cef into metal3-io:main Dec 9, 2024
43 of 45 checks passed
@metal3-io-bot metal3-io-bot deleted the kashif/remove-kube-rbac-proxy branch December 9, 2024 11:11
@metal3-io-bot metal3-io-bot added this to the BMO - v0.9 milestone Dec 9, 2024
@tuminoid
Copy link
Member

tuminoid commented Dec 9, 2024

/cherry-pick release-0.8

@metal3-io-bot
Copy link
Contributor

@tuminoid: #2102 failed to apply on top of branch "release-0.8":

Applying: Remove kube-rbac-proxy and use controller run-time provided auth filter instead
Using index info to reconstruct a base tree...
M	config/base/kustomization.yaml
M	config/render/capm3.yaml
M	go.mod
M	go.sum
M	main.go
Falling back to patching base and 3-way merge...
Auto-merging main.go
Auto-merging go.sum
CONFLICT (content): Merge conflict in go.sum
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
Auto-merging config/render/capm3.yaml
Removing config/base/rbac/auth_proxy_service.yaml
Removing config/base/rbac/auth_proxy_role_binding.yaml
Removing config/base/rbac/auth_proxy_role.yaml
Removing config/base/rbac/auth_proxy_client_clusterrole.yaml
Removing config/base/manager_auth_proxy_patch.yaml
Auto-merging config/base/kustomization.yaml
CONFLICT (content): Merge conflict in config/base/kustomization.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 0001 Remove kube-rbac-proxy and use controller run-time provided auth filter instead

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.

@tuminoid
Copy link
Member

tuminoid commented Dec 9, 2024

@kashifest shall we do manual cherry-pick? 0.8 support extends beyond rbac-proxy deprecation period.

@kashifest
Copy link
Member Author

@kashifest shall we do manual cherry-pick? 0.8 support extends beyond rbac-proxy deprecation period.

Good point, I will push it.

kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 10, 2024
❗ Following resources have been removed as part of this PR:

- ClusterRole: baremetal-operator-metrics-reader
- ClusterRole: baremetal-operator-proxy-role
- ClusterRoleBinding: baremetal-operator-proxy-rolebinding
- Service: baremetal-operator-controller-manager-metrics-service

Short description: kube-rbac-proxy was historically used to protect the metrics endpoint. However, its usage has been discontinued in Kubebuilder. The default scaffold now leverages the WithAuthenticationAndAuthorization feature provided by Controller-Runtime. This change is trigerred from the fact that the image gcr.io/kubebuilder/kube-rbac-proxy is deprecated and will become unavailable sometime from early 2025.

Signed-off-by: Kashif Khan <kashif.khan@est.tech>
kashifest added a commit to Nordix/cluster-api-provider-metal3 that referenced this pull request Dec 10, 2024
BMO manifests have removed kub-rbac-proxy due to deprecation. This PR adapts the e2e tests accordoingly.

For reference:
- metal3-io/baremetal-operator#2102
- metal3-io/baremetal-operator#2115

Signed-off-by: Kashif Khan <kashif.khan@est.tech>
kashifest added a commit to Nordix/cluster-api-provider-metal3 that referenced this pull request Dec 10, 2024
BMO manifests have removed kub-rbac-proxy due to deprecation. This PR adapts the e2e tests accordoingly.

For reference:
- metal3-io/baremetal-operator#2102
- metal3-io/baremetal-operator#2115

Signed-off-by: Kashif Khan <kashif.khan@est.tech>
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https

Choose a reason for hiding this comment

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

Where are the RBAC roles now required for controller runtime?
I think you forgot those.

Copy link
Member

Choose a reason for hiding this comment

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

Oh! @kashifest we need to test this and probably add some new RBAC

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed! I have put a PR for that #2116, I haven't tested them yet but those seem to me the missing RBACs

kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 11, 2024
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 <kashif.khan@est.tech>
kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 12, 2024
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 <kashif.khan@est.tech>
kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 12, 2024
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 <kashif.khan@est.tech>
kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 12, 2024
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 <kashif.khan@est.tech>
kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 12, 2024
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 <kashif.khan@est.tech>
kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 15, 2024
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 <kashif.khan@est.tech>
kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 16, 2024
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 <kashif.khan@est.tech>
kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 17, 2024
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 <kashif.khan@est.tech>
kashifest added a commit to Nordix/baremetal-operator that referenced this pull request Dec 20, 2024
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 <kashif.khan@est.tech>
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
None yet
Development

Successfully merging this pull request may close these issues.

⚠️ Action Required: Replace Deprecated gcr.io/kubebuilder/kube-rbac-proxy
6 participants