Skip to main content

Instance Uninstallation

Important Note:

  • Uninstallation will affect the availability of CSGHub services. Please perform this operation during off-peak hours and ensure data is backed up in advance.
  • A complete uninstallation will delete all associated data (including databases and storage files). Confirm that the data does not need to be retained before proceeding, as it cannot be recovered after deletion.

1. Confirm Deployment Information

Before uninstalling, confirm the status and details of the CSGHub Helm Release to ensure the correct target and avoid accidental operations. Run the following commands:

# List Helm Releases containing "csghub" in all namespaces to identify the instance
helm list -A | grep csghub

# View detailed configuration and status of the deployment to verify namespace and instance name
helm get all csghub -n csghub

2. Temporary Uninstallation (Keep History, Recoverable)

If you only need to uninstall CSGHub temporarily with plans to restore or reinstall it later, use the method that preserves deployment history. This allows for faster recovery later.

helm uninstall csghub -n csghub --keep-history

Description: After execution, CSGHub services will stop, but deployment history, Persistent Volume Claims (PVCs), and configurations are retained. Services can be restored later via Helm rollback or reinstallation.

3. Complete Uninstallation (Thorough Cleanup, Irrecoverable)

To completely remove all CSGHub-related resources, including services, data, configurations, and namespaces, follow these steps sequentially.

3.1 Uninstall Helm Release

Uninstall the CSGHub Helm instance to stop all related services:

helm uninstall csghub -n csghub

3.2 Delete All Persistent Data (PVCs)

Caution: This operation deletes all persistent data, such as databases and storage files. Data is irrecoverable once deleted. Ensure no data needs to be retained before execution.

kubectl delete pvc --all -n csghub

3.3 Delete Residual Secrets and ConfigMaps

Clean up remaining Secrets and ConfigMaps in the csghub namespace to avoid resource redundancy:

kubectl delete secret --all -n csghub
kubectl delete configmap --all -n csghub

3.4 Delete CSGHub Custom Resource Definitions (CRDs)

Remove CRDs associated with CSGHub to clean up cluster-level resources:

kubectl delete crd -l app.kubernetes.io/name=csghub

3.5 Remove CSGHub Helm Repository

If you no longer plan to deploy CSGHub, remove the local Helm repository configuration:

helm repo remove csghub

Delete the namespaces for CSGHub and its associated components (such as KnativeServing) to thoroughly clean up all resources:

kubectl delete namespace csghub --force
kubectl delete namespace knative-serving --force

Note: The --force flag ensures a thorough cleanup. If a namespace is stuck in the Terminating state, this command can help accelerate the deletion.

4. Uninstallation Verification

After completing the uninstallation, run the following commands to verify that resources have been thoroughly cleared:

# Verify Helm Release is removed
helm list -A | grep csghub

# Verify namespaces are deleted
kubectl get namespaces | grep -E "csghub|knative-serving"

# Verify CRDs are deleted
kubectl get crd -l app.kubernetes.io/name=csghub

If the commands above return no output, the CSGHub-related resources have been completely uninstalled.