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

We need flags to delete all dependent resources and configurations with deleting a cluster #406

Open
fernando-villalba opened this issue Apr 26, 2024 · 5 comments

Comments

@fernando-villalba
Copy link
Contributor

Issue

Currently when you create and delete clusters, it leaves too many dependent resources and configuration behind, for example:

  1. Firewalls
  2. Volumes (especially if creating apps)
  3. Kube config

Deleting all of these by hand or scripting it separately is very tedious

We need flags that delete these resources together with the cluster.

Acceptance Criteria

1. I suggest making the deletion of firewalls and kubeconfig the default, and keep volumes by default but provide option to get rid of them

After all, you can always revert your firewalls and config is only valid for that cluster, so no point in keeping them for the vast majority of cases.

And then have flags to delete the volumes that may have important data.

So you could have flags like this:

civo kubernetes delete --delete-volumes --> Deletes dependent volumes
civo kubernetes delete --keep-firewalls --> keeps dependent firewalls
civo kubernetes delete --keep-kubeconfig --> keeps dependent firewalls

2. When deleting clusters let the user know what was left behind

Aside outputting what cluster names and ids were deleted, also output the volumes that were left behind, and as an info message sent to stderr, you can mention the flag to delete dependent volumes next time.

@alejandrojnm
Copy link
Member

Can be a global one like --delete-dependent-resource that by default can be false and if you pass the api can delete all related object, we can use the same flag in terraform

@uzaxirr
Copy link
Member

uzaxirr commented Apr 30, 2024

@alejandrojnm
There is already such flag in API which automatically deletes all the related resources?
If yes then can you please specify which API.

@alessandroargentieri
Copy link
Member

@uzaxirr no we don't have and even the UI is not deleting them. We had some conversation around it multiple times, but they never translated into a practical action.

@harsh082ip
Copy link

Hey @fernando-villalba @uzaxirr, I can solve this issue. Could you assign it to me?

@harsh082ip
Copy link

I've submitted a pull request. Please review and let me know if any changes are required.
@fernando-villalba @uzaxirr @alejandrojnm @alejandrojnm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants