Delete Tenants
Delete a Tenant when the organization or division it represents is no longer needed. Tenant deletion is permanent and removes the Tenant from the PaletteAI hub cluster.
PaletteAI prevents you from deleting a Tenant that has child Projects. You must delete all Projects under the Tenant before you can delete the Tenant.
Limitations
- Tenant deletion is not available in the PaletteAI user interface at this time. Tenants must be deleted using Kubernetes manifests and
kubectlcommands as described in this guide.
Prerequisites
-
kubectl installed and available in your
$PATH. -
The
KUBECONFIGenvironment variable set to the path of the PaletteAI hub cluster'skubeconfigfile.export KUBECONFIG=<kubeconfig-location> -
A user with cluster-scoped permission to delete
Tenantresources. The default PaletteAI Tenant adminClusterRoledoes not grant delete onTenant. A cluster administrator must perform the deletion or grant explicitdeletepermission ontenants.spectrocloud.com. -
All child Projects under the Tenant deleted. Refer to Delete Projects for the Project deletion workflow.
Enablement
-
Verify the Tenant has no child Projects.
kubectl get tenant <tenant-name> --output jsonpath='{.status.childProjectCount}'The output must be
0. If the value is greater than zero, list the remaining Projects with the following command, then delete them before you continue. For the full workflow, refer to Delete Projects.kubectl get projects --all-namespaces --selector palette.ai/tenant-name=<tenant-name> -
Delete the Tenant.
kubectl delete tenant <tenant-name>Example commandkubectl delete tenant primary-dev -
(Optional) Delete the Tenant namespace.
PaletteAI does not automatically delete the
tenant-<tenant-name>namespace when you delete the Tenant. Before deleting it, confirm that no remaining Projects reference Settings resources in that namespace and that you no longer need any Secrets or Settings stored there.List the Settings in the Tenant namespace before deletion.
kubectl get settings --namespace tenant-<tenant-name>warningDeleting the Tenant namespace permanently deletes all Settings resources and integration Secrets it contains. Settings deletion automatically removes their referenced Secrets. Ensure you no longer need those credentials before proceeding.
kubectl delete namespace tenant-<tenant-name>Example commandkubectl delete namespace tenant-primary-dev
Validate
Verify the Tenant no longer exists.
kubectl get tenants
NAME DISPLAYNAME READY SETTINGS NAMESPACE PROJECTS AGE
default Default Tenant true default default 1 21d
Troubleshoot Tenant Deletion
If the Tenant delete request fails because child Projects remain, refer to Cannot Delete Tenant.