Skip to content

Update docs with AWS cleanup dos and don'ts #41

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

Merged
merged 4 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,50 @@

- [Introduction](#introduction)
- [AWS](#aws)
- [Prerequisites](#prerequisites)
- [General cleanup dos and don'ts](#general-cleanup-dos-and-donts)
- [VPCs](#vpcs)
- [Hosted zones](#route-53-hosted-zones)
- [S3 Buckets](#s3-buckets)
- [Cleanup resources by cluster identified](#cleanup-resources-by-cluster-identified)

## Introduction

Sometimes, a scenario can fail before a cluster is fully deprovisioned leaving stale resources in a cloud-provider (at the time of writing this, we only use AWS). If that occurs, the Interop team is responsible for cleaning that cluster up in the cloud-provider account to avoid any unwanted cost. This document will serve as a guide to how to manually cleanup a cluster in the cloud-provider platforms we use.
Sometimes, a scenario can fail before a cluster is fully deprovisioned leaving stale resources in a cloud-provider (at the time of writing this, we only use AWS). If that occurs, the Interop team is responsible for cleaning up that cluster in the cloud-provider account to avoid any unwanted cost. This document serves as a guide on how to manually clean up a cluster in the cloud-provider platforms we use.

## AWS

### Prerequisites

In order to perform manual cleanup and be able to delete resources in the cloud-provider account, users must belong to the watchers group, which subscribes to the EC2-delete policy and necessary permissions.

### General cleanup dos and don'ts

This section provides additional cleanup instructions for each resource type

It is generally safe to delete any resource whose name has one of the following prefixes:

* `ci-op-*`
* `ci-rosa-*`
* `mtc-*` (The MTC scenario has a unique prefix since it's deployed by the ocp-cli-installer)

#### VPCs

* In any AWS region: **_Don't_** delete any VPC whose `Default VPC` value is `Yes`

![default-vpc.png](img/default-vpc.png)

#### Route 53: Hosted zones

* **_Do_** ONLY delete `A Records` safely inside available hosted zones
* **_Don't_** delete any hosted zone which doesn't have the interop testing prefix mentioned above (there may be reserved resources for internal use)

#### S3 Buckets

* Similarly, **_don't_** delete any S3 bucket which doesn't have the interop testing prefix mentioned above (there may be reserved resources for internal use)

### Cleanup resources by cluster identified

In order to cleanup an OCP cluster provisioned through OpenShift CI in AWS, follow these steps:

1. Find the "name" of the cluster. Every cluster provisioned using OpenShift CI should have a unique name associated with it. This is how we know which AWS resources came from which Prow job.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading