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

Provision of deleting OCP cluster on AWS #10

Open
jyejare opened this issue Apr 7, 2022 · 9 comments
Open

Provision of deleting OCP cluster on AWS #10

jyejare opened this issue Apr 7, 2022 · 9 comments
Assignees
Labels
RFE New Feature Request
Milestone

Comments

@jyejare
Copy link
Collaborator

jyejare commented Apr 7, 2022

Requester: Prabodh Phuse

Issue: provision of deleting OCP cluster on AWS, which is a sum of various services and resources ...ec2, vpc, S3...etc

Urgency: Not mentioned but looks a promising future. But since cluster is a virtual resource of a cloud we need to rethink if cloudwash should get into virtual resources cleanup.

Willing to Contribute: Not mentioned!

@jyejare jyejare added the RFE New Feature Request label May 11, 2022
@apodhrad
Copy link

apodhrad commented May 16, 2022

Hi @jyejare this description is a bit confusing to me. It seems that this is about simulation OCP uninstallation process via OCP installer.

But I think the goal is more general - delete more type of resources. So, I suggest to rename this issue to something like "Add more resource types which can be deleted by CloudWash", wdyt?

@apodhrad
Copy link

apodhrad commented Jun 6, 2022

btw, for deleting VPCs I use the following script
https://github.com/lianghong/delete_vpc

@jyejare
Copy link
Collaborator Author

jyejare commented Jun 7, 2022

@apodhrad The request is from Prabhod and even I didn't look into it in the dip but the Issue description is giving a more context.

It seems he would like to clean up the resources (EC2, VPC, S3) on OCP cluster where the cluster is deployed on AWS and not the uninstallation of the actual cluster. Just FYI, The installation of cluster on AWS is documented https://docs.openshift.com/container-platform/4.6/installing/installing_aws/installing-aws-default.html.

To clean up the resources on the cluster deployed on AWS, we can either take the route of deleting it using AWS APIs or OCP APIs whichever route is permissible, provides more benefits in future as to delete more resources in cluster.

@lukas-bednar
Copy link

We use AWS only for deploying the OCP clusters. So we need this feature as well.

Note that all OCP resources are being tagged, so you can simply inspect items which you are going to delete, and if you find kubernetes.io/cluster/${CLUSTER_ID} between the tag, you know that it belongs to the OCP cluster, and your desire here is to remove all resources which are tagged with the same tag.

Note that this request is also relevant for other clouds, not only AWS ...

@apodhrad
Copy link

apodhrad commented Jun 8, 2022

Right, so maybe we could consider introducing a new variable DELETE_OCP which will work similar to DELETE_VM.
That means, if we identified a VM or VPC with tag kubernetes.io/cluster/${DELETE_OCP}* then we can just uninstall the OCP using the OCP installer.

@apodhrad
Copy link

apodhrad commented Jun 8, 2022

The question is - which resource(s) should we look for and check the tag kubernetes.io/cluster/${CLUSTER_ID}.

Maybe we could look for VPCs as many resources are directly tied with a VPC.
Here is an example of VPC tag

  "Tags": [
    {
      "Key": "Name",
      "Value": "ocp4-23-6xcdn-vpc"
    },
    {
      "Key": "kubernetes.io/cluster/ocp4-23-6xcdn",
      "Value": "owned"
    }

I'm just not sure what is the alternative for VPC in other cloud providers such as Azure or GCP

@apodhrad
Copy link

If someone is interested I have prepared a quick PoC (WIP) at
#18

@bovem
Copy link

bovem commented Oct 9, 2022

I would like to propose a feature for the cleanup of OCP resources like PipelineRuns, Pods, Deployments, etc.
I can take a look at this and create a PR if required.

@jyejare
Copy link
Collaborator Author

jyejare commented Oct 11, 2022

@bovem For now @apodhrad is now looking into cluster cleanup but you can create a new issue and work on it :)

@jyejare jyejare modified the milestones: Release 1.1.0, Release 1.2.0 Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFE New Feature Request
Projects
None yet
Development

No branches or pull requests

4 participants