Skip to main content
Version: 3.11

Protect Resources From Deletion/Modification

KubeRocketCI allows to prevent accidental resource deletion and modification by applying a protected label. This page describes the protected label feature, its purpose, types, and usage.

Overview​

Protected label is a Kubernetes label that tells KubeRocketCI to block any delete or edit operations with the resource. The platform checks the label first before performing an operation with the resource.

Protected labels support the following resources:

Protection Types​

Protection label can optionally block specific operations over a resource:

  • app.edp.epam.com/edit-protection: delete-update - Blocks both the delete and modify operations;
  • app.edp.epam.com/edit-protection: delete - Blocks only delete operations;
  • app.edp.epam.com/edit-protection: update - Blocks only modify operations.

Apply Protected Label​

To apply the resource deletion and modification block, follow the steps below. We will use a codebase resource as an example, but the procedure applies to all the supported resources:

  1. Navigate to the KubeRocketCI portal.

  2. Switch the portal to the Kubernetes mode:

Kubernetes mode

  1. Navigate to Cluster -> Custom resources:

Custom resources tab

  1. In the custom resources list, enter Codebase in the filter field to find it and then select it in the list:

Codebase resource type

  1. Enter the codebase you want to protect from accidental deletion and/or modification.

  2. On the resource details page, click the Edit button:

Edit button

  1. In the edit resource window, add the label to the labels section and click Save and apply:

Add label

  1. Make sure the label was applied:

Verify label

  1. Switch back to the KubeRocketCI mode, navigate to the Components section and verify that you can't delete or edit the protected codebase:

Deletion/Modification is locked

Remove Protected Label​

To remove a label, navigate back to the resource, edit the resource by removing the label, and save the changes.