Deletion Protection
To enhance security and prevent unintended removal of critical resources, we've introduced deletion protection for Organizations, Tenants, Workspaces, and Groups. This documentation provides an overview of the features and how to manage them.
Features
-
deletionProtectionEnabled
Field: This is a new attribute added to resources, namely Organizations, Tenants, Workspaces, and Config Groups (Gateway Groups, Traffic Group, Security Group and Istio Internal Group). By default, this field is set todisabled
, meaning resources can be deleted unless this protection is explicitly enabled.To enable deletion protection, set the
spec.deletionProtectionEnabled
field totrue
in the resource's YAML file. For example, to enable deletion protection on a Tenant, add the following to the YAML file:apiVersion: tsb.tetrate.io/v2
kind: Tenant
metadata:
name: tenant-name
annotations:
tsb.tetrate.io/organization: tetrate
spec:
displayName: Tenant Name
deletionProtectionEnabled: true -
Hierarchical Resource Protection: Protection isn’t just on a single-resource level. If a resource is protected or if any of its child resources have deletion protection enabled, the parent resource cannot be deleted. This ensures that inadvertent deletions don't affect dependent or related resources.
To understand TSB Hierarchical Resource, please refer to TSB Resource Model.
-
Modifying Deletion Protection: Before a protected resource can be deleted, the
deletionProtectionEnabled
flag must be cleared or set todisabled
. This adds an additional layer of confirmation, ensuring that resources aren't deleted accidentally. -
-
-force
Flag on tctl delete Command: For users who wish to bypass the standard deletion protection measures, the--force
flag has been introduced. When using thetctl delete
command with the--force
flag, the resource will be deleted without the need to manually clear thedeletionProtectionEnabled
property first. Caution is advised when using this flag as it overrides the built-in safety measures.
Guidelines for Using Deletion Protection:
- Enable Protection Where Necessary: While the default setting is
disabled
, it's recommended to enable deletion protection on critical resources to prevent unintentional loss. - Regularly Review Protected Resources: Periodically review and ensure that the correct resources are protected. This prevents any hindrance when intentional deletions are required.
- Use
--force
Flag with Caution: The force delete option is powerful and can lead to unintentional data loss. Always confirm the details of the resource before proceeding with a force delete.
The deletion protection feature is here to aid in preserving the integrity and structure of your resources. Use it wisely to ensure that your data and configurations remain safe and intact.