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

🐛 Delete provider's CRDs and namespace along with the provider custom resource #169

Closed
wants to merge 1 commit into from

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Jun 18, 2023

What this PR does / why we need it:

Now we keep provider's namespace and CRDs after we delete the provider, which pollutes the system. System administrators have to manually delete stalled objects after that. After this PR operator will delete all providers components completely.

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 #120

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 18, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from fedosin. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 18, 2023
@Fedosin Fedosin changed the title 🐛 Delete all provider components 🐛 Delete provider's CRDs and namespace along with the provider custom resource Jun 18, 2023
Now we keep provider's namespace and CRDs after we delete the provider,
which polutes the system. System administrators have to manually delete
stalled objects after that. After this PR operator will delete all
providers components completely.
@alexander-demicev
Copy link
Contributor

The initial idea was to have an identical behavior as clusterctl https://cluster-api.sigs.k8s.io/clusterctl/commands/delete.html#clusterctl-delete where namespaces and CRDs are not deleted. cc @richardcase @furkatgofurov7

@Fedosin
Copy link
Contributor Author

Fedosin commented Jun 20, 2023

Maybe it makes sense to split this PR in two parts: one related to CRDs and namespaces, and another to all other cluster-scoped resources. For instance, now we don't delete clusterroles and clusterrolebinding, which is clearly a bug.

But ideally, we need to discuss the process of provider deletion in detail. Now namespaced resources are deleted because they have an owner reference to the provider object, and some cluster scoped resources are removed with clusterctl's delete. I think it's inconsistent and should be improved.

@furkatgofurov7
Copy link
Member

furkatgofurov7 commented Jun 21, 2023

The initial idea was to have an identical behavior as clusterctl https://cluster-api.sigs.k8s.io/clusterctl/commands/delete.html#clusterctl-delete where namespaces and CRDs are not deleted. cc @richardcase @furkatgofurov7

Agree. Thinking of a use case we can of course delete everything in the most common use case we have, which is single-tenant management clusters. However I think it might be destructive in multi-tenant scenario, because then we would delete both instance specific and shared CRDs/web-hook components.

@Fedosin
Copy link
Contributor Author

Fedosin commented Jun 22, 2023

/hold

We decided to split this PR in two parts - one that fixes the bug with undeleted resources, and another that allows to regulate whether namespace and CRDs should be deleted or not.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 22, 2023
@Fedosin
Copy link
Contributor Author

Fedosin commented Jul 21, 2023

Close it for now...

@Fedosin Fedosin closed this Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CRDs are not deleted when provider is removed
4 participants