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

Unnecessary RoleBinding reconciliations are triggered #315

Closed
prometherion opened this issue Jul 1, 2021 · 0 comments · Fixed by #316
Closed

Unnecessary RoleBinding reconciliations are triggered #315

prometherion opened this issue Jul 1, 2021 · 0 comments · Fixed by #316
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@prometherion
Copy link
Member

Bug description

Noticed this thanks for #243 getting implemented, having more visibility on the underlying requests in a managed Namespace.

It seems Capsule performs multiple reconciliation requests for the namespace:admin and namespace-deleter RoleBinding.

How to reproduce

  1. Install Capsule on Kind
  2. Create a Tenant
  3. Create several Namespaces (+100)
  4. check logs

Expected behavior

A single reconciliation (or at least, a maximum of two) should occur.

Logs

2021-07-01T16:19:16.960+0200    INFO    controllers.Tenant      Role Binding sync result: updated       {"Request.Name": "oil", "name": "namespace:admin", "namespace": "oil-26"}
2021-07-01T16:19:16.962+0200    DEBUG   controller-runtime.manager.events       Normal  {"object": {"kind":"Tenant","name":"oil","uid":"71123193-5b4f-4683-9d24-6128f7caf3a1","apiVersion":"capsule.clastix.io/v1alpha1","resourceVersion":"482900"}, "reason": "oil-26", "message": "Ensuring Capsule RoleBinding namespace:admin"}
2021-07-01T16:19:17.089+0200    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/cordoning", "UID": "97c7bcff-375f-4fbf-901a-906b0af04dfa", "kind": "rbac.authorization.k8s.io/v1, Kind=RoleBinding", "resource": {"group":"rbac.authorization.k8s.io","version":"v1","resource":"rolebindings"}}
2021-07-01T16:19:17.089+0200    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/cordoning", "code": 200, "reason": "", "UID": "97c7bcff-375f-4fbf-901a-906b0af04dfa", "allowed": true}
2021-07-01T16:19:17.221+0200    INFO    controllers.Tenant      Role Binding sync result: updated       {"Request.Name": "oil", "name": "namespace:admin", "namespace": "oil-24"}
2021-07-01T16:19:17.224+0200    DEBUG   controller-runtime.manager.events       Normal  {"object": {"kind":"Tenant","name":"oil","uid":"71123193-5b4f-4683-9d24-6128f7caf3a1","apiVersion":"capsule.clastix.io/v1alpha1","resourceVersion":"482900"}, "reason": "oil-24", "message": "Ensuring Capsule RoleBinding namespace:admin"}
2021-07-01T16:19:17.357+0200    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/cordoning", "UID": "cbb803bc-2321-4d39-b80b-f66d0a494834", "kind": "rbac.authorization.k8s.io/v1, Kind=RoleBinding", "resource": {"group":"rbac.authorization.k8s.io","version":"v1","resource":"rolebindings"}}
2021-07-01T16:19:17.357+0200    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/cordoning", "code": 200, "reason": "", "UID": "cbb803bc-2321-4d39-b80b-f66d0a494834", "allowed": true}
2021-07-01T16:19:17.490+0200    INFO    controllers.Tenant      Role Binding sync result: updated       {"Request.Name": "oil", "name": "namespace:admin", "namespace": "oil-43"}
2021-07-01T16:19:17.490+0200    DEBUG   controller-runtime.manager.events       Normal  {"object": {"kind":"Tenant","name":"oil","uid":"71123193-5b4f-4683-9d24-6128f7caf3a1","apiVersion":"capsule.clastix.io/v1alpha1","resourceVersion":"482900"}, "reason": "oil-43", "message": "Ensuring Capsule RoleBinding namespace:admin"}
2021-07-01T16:19:17.648+0200    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/cordoning", "UID": "4650ead2-ee86-4a07-be7b-4ccfc3fe5fdb", "kind": "rbac.authorization.k8s.io/v1, Kind=RoleBinding", "resource": {"group":"rbac.authorization.k8s.io","version":"v1","resource":"rolebindings"}}
2021-07-01T16:19:17.656+0200    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/cordoning", "code": 200, "reason": "", "UID": "4650ead2-ee86-4a07-be7b-4ccfc3fe5fdb", "allowed": true}
2021-07-01T16:19:17.784+0200    INFO    controllers.Tenant      Role Binding sync result: updated       {"Request.Name": "oil", "name": "namespace-deleter", "namespace": "oil-54"}
2021-07-01T16:19:17.785+0200    DEBUG   controller-runtime.manager.events       Normal  {"object": {"kind":"Tenant","name":"oil","uid":"71123193-5b4f-4683-9d24-6128f7caf3a1","apiVersion":"capsule.clastix.io/v1alpha1","resourceVersion":"482900"}, "reason": "oil-54", "message": "Ensuring Capsule RoleBinding namespace-deleter"}

Additional context

  • Capsule version: HEAD~0d4201a
  • Helm Chart version: irrelevant
  • Kubernetes version: irrelevant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant