Uninstall Pluggable Components from KubeSphere

After you enable pluggable components of KubeSphere, you can also uninstall them using the following commands. Please back up any necessary data before you uninstall them.

App Store

  1. kubectl delete ns openpitrix-system

Metrics Server

  1. helm delete metrics-server -n kube-system

Events

  1. helm delete ks-events -n kubesphere-logging-system

Auditing

  1. helm delete kube-auditing -n kubesphere-logging-system

Logging

  1. kubectl delete ns kubesphere-logging-system

Optional:

  1. # Uninstall es and curator
  2. helm uninstall -n kubesphere-logging-system elasticsearch-logging
  3. helm uninstall -n kubesphere-logging-system elasticsearch-logging-curator
  4. # Uninstall fluent bit operator and fluent bit
  5. kubectl delete -f https://github.com/kubesphere/fluentbit-operator/tree/v0.2.0/manifests/logging-stack
  6. kubectl delete -f https://github.com/kubesphere/fluentbit-operator/tree/v0.2.0/manifests/setup
  7. # Uninstall log sidecar injector
  8. helm uninstall -n kubesphere-logging-system logsidecar-injector

Alerting and Notification

  1. kubectl delete ns kubesphere-alerting-system

To uninstall alerting only:

  1. kubectl delete deployment -n kubesphere-alerting-system alerting-client alerting-executor alerting-manager alerting-watcher
  2. kubectl delete svc -n kubesphere-alerting-system alerting-client-server alerting-manager-server

To uninstall notification only:

  1. kubectl delete deployment -n kubesphere-alerting-system notification-deployment
  2. kubectl delete svc -n kubesphere-alerting-system notification

Note

Alerting and notification are often enabled at the same time, which run together in the namespace kubesphere-alerting-system.

Service Mesh

  1. helm -n istio-system delete istio-init
  2. helm -n istio-system delete istio
  3. helm -n istio-system delete jaeger-operator
  4. kubectl delete ns istio-system

DevOps

  1. helm -n kubesphere-devops-system delete ks-jenkins
  2. helm -n kubesphere-devops-system delete uc
  1. # Delete DevOps projects
  2. for devopsproject in `kubectl get devopsprojects -o jsonpath="{.items[*].metadata.name}"`
  3. do
  4. kubectl patch devopsprojects $devopsproject -p '{"metadata":{"finalizers":null}}' --type=merge
  5. done
  6. for pip in `kubectl get pipeline -A -o jsonpath="{.items[*].metadata.name}"`
  7. do
  8. kubectl patch pipeline $pip -n `kubectl get pipeline -A | grep $pip | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
  9. done
  10. for s2ibinaries in `kubectl get s2ibinaries -A -o jsonpath="{.items[*].metadata.name}"`
  11. do
  12. kubectl patch s2ibinaries $s2ibinaries -n `kubectl get s2ibinaries -A | grep $s2ibinaries | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
  13. done
  14. for s2ibuilders in `kubectl get s2ibuilders -A -o jsonpath="{.items[*].metadata.name}"`
  15. do
  16. kubectl patch s2ibuilders $s2ibuilders -n `kubectl get s2ibuilders -A | grep $s2ibuilders | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
  17. done
  18. for s2ibuildertemplates in `kubectl get s2ibuildertemplates -A -o jsonpath="{.items[*].metadata.name}"`
  19. do
  20. kubectl patch s2ibuildertemplates $s2ibuildertemplates -n `kubectl get s2ibuildertemplates -A | grep $s2ibuildertemplates | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
  21. done
  22. for s2iruns in `kubectl get s2iruns -A -o jsonpath="{.items[*].metadata.name}"`
  23. do
  24. kubectl patch s2iruns $s2iruns -n `kubectl get s2iruns -A | grep $s2iruns | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
  25. done
  26. kubectl delete devopsprojects --all 2>/dev/null
  1. kubectl delete ns kubesphere-devops-system

Note

For the component NetworkPolicy, disabling it does not require uninstalling the component as its controller is now inside ks-controller-manager. If you want to remove it from the KubeSphere console, change networkPolicy.enabled to false in ks-installer.