Platform Cleanup Guide
Throughout your project's lifecycle, various resources are created within the KubeRocketCI platform. Over time, some of these resources may become deprecated. It is crucial to clean up any associated artifacts to ensure the platform functions correctly, especially if you intend to re-add a component with the same name.
This page provides comprehensive guidelines for completely deleting resources in KubeRocketCI, from applications to third-party resources.
Prerequisitesβ
To follow the guidelines below, ensure you have:
- Admin access to the KubeRocketCI portal
- Admin access to third-party tools (Nexus, SonarQube, container registry, Git, etc.)
Platform Resource Cleanupβ
This section covers platform resource removal, such as components, deployment flows, and pipeline runs.
Delete Deployment Flowsβ
Platform cleanup starts with deleting deployment flows, a core resource that allows the platform to build an automated workflow. Deleting a deployment flow will delete applications from its associated cluster.
We recommend cleaning environments before deleting deployment flows to ensure graceful resource deletion and avoid potential issues.
There are two strategies for cleaning environments:
- Using the delete option: This strategy involves using the Delete button to remove an environment. Itβs suitable for environments that donβt rely on specific workload setups to deploy.
- Using a clean pipeline: This strategy involves creating a clean pipeline to handle the deletion of third-party dependencies, such as cloud resources and databases, that share the same lifecycle as your environment. We recommend this strategy for applications with complex third-party interactions.
To delete an environment using the Delete button, read the Manage Environments page.
A deployment flow must include at least one environment.
Once the environments are deleted, proceed with deleting a deployment flow. To delete a deployment flow, follow these steps:
- Navigate to KubeRocketCI portal -> Deployment flows:
- Choose a deployment flow to delete. Click the actions button and select Delete:
- Enter the deployment flow name and click Delete:
Delete Codebasesβ
After deleting deployment flows, you can delete the associated resources they operate with. These resources, collectively referred to as codebases, include applications, libraries, autotests, and infrastructures.
In this example, we will demonstrate how to delete an application. The same procedure applies to other types of codebases:
- Navigate to KubeRocketCI portal -> Components:
- Choose an application to delete. Click the actions button and select Delete:
- Enter the application name and click Delete:
Delete Pipeline Runsβ
The last platform resource remaining is pipeline runs. A pipeline run refers to an execution instance of a pipeline. Each time you trigger a build, review, deploy, or clean pipeline, a new pipeline run emerges. To delete pipeline runs, follow these steps:
- Navigate to KubeRocketCI portal -> Pipelines:
- Choose pipeline runs and click Delete:
- On the confirmation window, enter confirm and click Delete:
Third-Party Resource Cleanupβ
KubeRocketCI supports integrations with a wide range of third-party tools, many of which are involved in the codebase management process. Therefore, it is crucial to clean up resources associated with these integrations.
Version Control Systemsβ
If you want to re-add a component with the same name, cleaning up artifacts is mandatory for correct platform operation. When using a create or clone strategy, codebase operator provisions a repository in the Version Control System (VCS) each time you create a new codebase.
When re-adding a repository instead of deleting it, clear repository tags to prevent versioning conflicts. For re-adding a Helm chart, clean the deploy-templates folder.
Below are links to the official documentation for deleting code repositories:
- GitHub
- GitLab
- Bitbucket
- Gerrit
To delete a GitHub repository, read the Deleting a repository page.
To delete a GitLab repository, read the Manage projects page.
To delete a Bitbucket repository, read the Delete a repository page.
To delete a Gerrit repository, refer to the Project Deletion section.
Delete Nexus Artifactsβ
KubeRocketCI uses Nexus Repository Manager as an artifact registry for storing application binaries.
If the Nexus instance is installed using add-ons, a predefined cleanup policy is deployed along with it. This policy automatically deletes unused images after 30 days. Ensure that the policy is activated to enable successful automatic cleanup.
Repository Types in Nexusβ
A Nexus repository is a collection of components such as JAR files, Docker images, and other artifacts. KubeRocketCI uses the following repository types:
- Container Repository: Stores container images and Helm charts.
- Maven Repository: Handles Maven artifacts like JARs and POMs.
- Dotnet Repository: Manages NuGet packages.
- NPM Repository: Stores NPM packages.
- Python Repository: Hosts Pip packages.
- Yum Repository: Stores RPM packages.
Repository Structureβ
Repositories are categorized into the following types:
- Hosted: Stores locally uploaded artifacts (e.g., krci-npm-hosted).
- Group: Aggregates multiple repositories for unified access (e.g., krci-maven-group).
- Proxy: Mirrors artifacts from remote repositories (e.g., krci-maven-proxy).
Manual Deletion Procedureβ
To clean up unnecessary application binaries manually, follow these steps:
- Navigate to Nexus main menu and select the Browse tab:
- On the Browse tab, select the folder with the name that represents the application type:
For example, to delete a .NET application, navigate to krci-dotnet-releases or krci-dotnet-snapshots folder. Understanding the difference between the release and snapshot folders is essential:
- Releases: This repository type stores applications built in release branches. These applications are usually tagged as release candidates (RC).
- Snapshots: This type of repository stores other applications and their versions, usually tagged as snapshots.
- In the Nexus repository, select the package folder and click Delete folder:
- (Optional) Repeat steps 1-3 for all the packages that need to be cleaned up.
Delete Container Imagesβ
KubeRocketCI uses container images to deploy the applications to deployment flows. To clean up a container registry, follow the corresponding guidelines:
- AWS ECR
- DockerHub
- Harbor
- Nexus
- GitHub
To delete container images from the AWS Elastic Container Registry, read the Deleting an image in Amazon ECR page.
To delete container images from DockerHub, read the Delete a repository page.
To delete container images from Harbor, read the Deleting Artifacts page.
- Navigate to Nexus main menu and select the Browse tab:
- On the Browse tab, select the repository with the krci-container-hosted name:
- On the repository details page, select the folder name and click Delete folder:
To delete container images from GitHub Container Registry, read the Working with the Container registry page.
Delete SonarQube Projectsβ
KubeRocketCI generates a SonarQube project for every new codebase. To clean up application projects, follow the guidelines described in the official documentation. Deleting a codebase without removing the corresponding SonarQube project may lead to issues in review pipelines.
Observability Toolsβ
KubeRocketCI supports various observability tools, including DefectDojo, Dependency-Track, Datadog, and more. While these tools don't directly impact the platform's core functionality, they can generate significant data during operation.
Some tools, such as Dependency-Track and SonarQube, offer deep integration with KubeRocketCI through dedicated widgets. These widgets allow users to view code quality metrics and dependency scan results directly in the codebase details menu:
DefectDojoβ
There are two methods to delete observability data from DefectDojo:
- By deleting a product: This method lets you delete observability data for the entire KubeRocketCI platform simultaneously.
- By deleting engagements: This method lets you selectively delete data for specific codebases.
Deleting a DefectDojo product is preferable if you no longer need your product's security scans. Typically, the product name matches the Kubernetes namespace. A product is deleted on the product's details page:
Deleting engagements will clean up security scan runs for specific codebases. This method is preferable when retaining certain parts of the product's data. To find the security scans for specific codebases, use search filters:
To delete an engagement, click the three dots icon and select Delete:
Dependency-Trackβ
At the moment, Dependency-Track has fewer options for selectively deleting data. Therefore, it is often preferable to delete an entire Dependency-Track project.
To delete a Dependency-Track project, follow these steps:
- Log into your Dependency-Track instance.
- Open the Projects list and find the project you want to delete.
- Enter the project details by clicking its name:
- In the project's details page, click the View Details button:
- On the project details menu, click Delete: