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

🐛 fix rbac aggregation manager role #743

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

seanschneeweiss
Copy link
Contributor

What this PR does / why we need it:
The manager aggregation patch for kustomization does not match the correct ClusterRole. This fix ensures to use the correct ClusterRole definition, instead of overwriting it with the broken patch.

We've seen the following errors:

[manager] E0211 09:08:55.893564       8 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.9/tools/cache/reflector.go:105: Failed to list *v1alpha3.OpenStackCluster: openstackclusters.infrastructure.cluster.x-k8s.io is forbidden: User "system:serviceaccount:capo-system:default" cannot list resource "openstackclusters" in API group "infrastructure.cluster.x-k8s.io" at the cluster scope: RBAC: clusterrole.rbac.authorization.k8s.io "capi-system-capi-aggregated-manager-role" not found
[manager] E0211 09:08:55.893677       8 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.9/tools/cache/reflector.go:105: Failed to list *v1alpha3.OpenStackMachine: openstackmachines.infrastructure.cluster.x-k8s.io is forbidden: User "system:serviceaccount:capo-system:default" cannot list resource "openstackmachines" in API group "infrastructure.cluster.x-k8s.io" at the cluster scope: RBAC: clusterrole.rbac.authorization.k8s.io "capi-system-capi-aggregated-manager-role" not found

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:
Removing the config/default/manager_role_aggregation_patch.yaml patch should fix this problem.

Release note:

NONE

Sean Schneeweiss sean.schneeweiss@daimler.com, Daimler TSS GmbH, legal info/Impressum

THe manager aggregation patch for kustomization does not match
the correct ClusterRole. This fix ensures to use the correct ClusterRole
definition, instead of overwriting it with the broken patch.

Co-authored-by: Tobias Giese <tobias.giese@daimler.com>
Signed-off-by: Sean Schneeweiss <sean.schneeweiss@daimler.com>
@k8s-ci-robot
Copy link
Contributor

Hi @seanschneeweiss. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 16, 2021
@fejta-bot
Copy link

Unknown CLA label state. Rechecking for CLA labels.

Send feedback to sig-contributor-experience at kubernetes/community.
/check-cla

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 16, 2021
@theopenlab-ci
Copy link

theopenlab-ci bot commented Feb 16, 2021

Build failed.

@sbueringer
Copy link
Member

recheck

@sbueringer
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 17, 2021
@sbueringer
Copy link
Member

sbueringer commented Feb 17, 2021

@hidekazuna @jichenjc
Some additional info:

  • we compared the CAPO implementation with the one in CAPA:
    • the general pattern seems to be to just define and use the ClusterRole (and ClusterRoleBinding) inside of CAPA/CAPO
    • our current master implementation has a ClusterRolebinding which depends on a ClusterRole of the ClusterAPI main deployment, which in turn refers back to ours
    • but because this ClusterRoleBinding has the same name as our own it is usually overwritten.
    • Afaik this somehow still works when using clusterctl but not when deploying the regular YAML files
    • CAPA still has the kustomize patch file we're deleting here, but they are not using it (and thus it's not contained in the release yamls)

Slightly off-topic:

  • we're slowly starting to use CAPO in production right now, so just fyi, there will be a lot more PRs and contributions from my team in the coming weeks/ months :)

@sbueringer
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer, seanschneeweiss

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 17, 2021
@theopenlab-ci
Copy link

theopenlab-ci bot commented Feb 17, 2021

Build failed.

@hidekazuna
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 17, 2021
@k8s-ci-robot k8s-ci-robot merged commit b9d581c into kubernetes-sigs:master Feb 17, 2021
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants