cloud-disks-cleaner

command module
v0.0.0-...-a432987 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

cloud-disks-cleaner

Version Widget License Widget GoReportCard Widget DockerHub Widget

Cloud disks cleaner

Brief description of what the project does. Description

This project is designed to run within a Kubernetes cluster, preferably on Google Kubernetes Engine (GKE). Its primary purpose is to identify and remove unused Google Cloud Platform (GCP) disks. This includes disks that are not attached to any virtual machines and do not have an associated Persistent Volume (PV) or Persistent Volume Claim (PVC) in Kubernetes. The project helps to keep the GCP environment clean by removing unused resources, which can contribute to cost reduction and more efficient resource management.

Script that runs as a cronjob resource in kubernetes in GKE environments. Removes disks from GCP that are not in use. If PV does not exists in kubernetes, we can remove the disk in GCP. If PV does exists, but pvc is not bound to the pv, we can remove the disk in GCP.

How It Works

The project follows these steps:

Load Configuration: Reads the necessary configuration to run the application.
Initialize Services: Sets up the necessary services to interact with GCP and Kubernetes.
Run the Application: Performs the following operations:
    Lists disks in GCP and checks if they are being used.
    Checks if these disks have associated PVs or PVCs in Kubernetes.
    Deletes the disks that are not in use in GCP.

Installation

(Provide here the steps to install the project, e.g., cloning the repository, installing dependencies, etc.) Usage

GO111MODULE=on
go build .

Describe how to run or use the application, including any necessary configuration parameters.

Example of how to run the application

Command to run the application (if applicable)

Contribution

Instructions for those who wish to contribute to the project. License

Include details about the license under which the project is distributed.

Documentation

Overview

main.go

Directories

Path Synopsis
internal
app
pkg
gcp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL