-
Notifications
You must be signed in to change notification settings - Fork 89
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 cleanup logic for IAM policy bindings #566
Conversation
* We are not properly GC'ing policy bindings for deleted service accounts. * The problem is that we only consider service accounts matching a certain regex and that regex isn't matching service accounts for our auto-deployed clusters. * Using a regex should be unnecessary. If a service account doesn't exist that should be a sufficient criterion that the policy bindings should be deleted. Related to: kubeflow#543
/assign @richardsliu |
Here are the logs from a one off run. It looks like a bunch of old bindings were GC'd. Here's the current policy. kubeflow.ci.deployment.policy.txt Looks like a bunch of bindings were pruned. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: richardsliu 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 |
This reverts commit 4ebe571. The list of service accounts only includes service accounts owned by the project. So we ended up deleting bindings for service accounts owned by other projects such as the service accounts. related to: kubeflow#566
…)"" This reverts commit f163829.
* We want to cleanup bindings for service accounts that don't exist as a way to GC any bindings that might otherwise accumulate. * However, we only want to GC bindings for service accounts that are owned by that project because only those service accounts will be listed as service accounts for that project e.g. in the project kubeflow-ci-deployment; we should only delete bindings for the service accounts ${NAME}@kubeflow-ci-deployment.iam.gserviceaccount.com Any other bindings should be preserved. * related to: kubeflow#566
* We want to cleanup bindings for service accounts that don't exist as a way to GC any bindings that might otherwise accumulate. * However, we only want to GC bindings for service accounts that are owned by that project because only those service accounts will be listed as service accounts for that project e.g. in the project kubeflow-ci-deployment; we should only delete bindings for the service accounts ${NAME}@kubeflow-ci-deployment.iam.gserviceaccount.com Any other bindings should be preserved. * related to: kubeflow#566
* We want to cleanup bindings for service accounts that don't exist as a way to GC any bindings that might otherwise accumulate. * However, we only want to GC bindings for service accounts that are owned by that project because only those service accounts will be listed as service accounts for that project e.g. in the project kubeflow-ci-deployment; we should only delete bindings for the service accounts ${NAME}@kubeflow-ci-deployment.iam.gserviceaccount.com Any other bindings should be preserved. * related to: kubeflow#566
* Fix cleanup logic for IAM policy bindings. * We want to cleanup bindings for service accounts that don't exist as a way to GC any bindings that might otherwise accumulate. * However, we only want to GC bindings for service accounts that are owned by that project because only those service accounts will be listed as service accounts for that project e.g. in the project kubeflow-ci-deployment; we should only delete bindings for the service accounts ${NAME}@kubeflow-ci-deployment.iam.gserviceaccount.com Any other bindings should be preserved. * related to: #566 * Cleanup. * Add dryrun logging. * Update PR. * Fix lint.
We are not properly GC'ing policy bindings for deleted service accounts.
The problem is that we only consider service accounts matching a certain
regex and that regex isn't matching service accounts for our auto-deployed
clusters.
Using a regex should be unnecessary. If a service account doesn't exist
that should be a sufficient criterion that the policy bindings should be
deleted.
Related to: #543
This change is