Protect Precious Entities
ConfigHub makes operations, including bulk operations, pretty easy to perform.
This reduces friction in typical cases, but also makes it easy to delete units and spaces corresponding to production infrastructure.
To prevent accidental deletion or destruction, ConfigHub supports delete and destroy gates.
You can add delete and/or destroy gates when creating entities and with update.
For example, to add delete and destroy gates to a database unit with the CLI, you can do:
cub unit update --patch --delete-gate critical --destroy-gate critical --space prod database
You'll also want to protect spaces that are in use:
cub space update --patch --delete-gate used-until-dec25 kubecon25-demo
A delete gate refuses deleting and archiving the entity. A destroy gate on a unit refuses a Release that would remove what the latest Release deployed of the unit, by bundling it empty or leaving it out, and withdrawing the latest Release when the one served in its place does not deploy the unit. Emptying the unit, and deleting it, are not destroy-gated; the delete gate covers the delete, and ConfigHub puts its own Released delete gate on each unit a Release deploys, so a released unit is not deleted until a Release has removed its resources. See gates.
The string specified as the gate has the same restrictions as label keys: alphanumeric plus -, _, and .. It's useful to provide information regarding the purpose of the gate and/or why/when the entity is needed.
To remove a gate, use -:
cub space update --patch --delete-gate used-until-dec25=- kubecon25-demo
cub space delete --recursive kubecon25-demo
Gates protect entities from deletion and destruction. To keep specific configuration values from being overwritten, see protecting a variant's own values, with an Override guard that holds against merges from upstream, and guarding values against every change.