您正在查看 KubeSphere 版本的文档:v3.0.0

KubeSphere v3.0.0 版本的文档已不再维护。您现在看到的版本来自于一份静态的快照。如需查阅最新文档,请点击 最新版本

从 KubeSphere 上卸载可插拔组件

启用 KubeSphere 的可插拔组件之后,您也可以使用以下命令来卸载这些组件。卸载之前,请将必要的数据进行备份。

应用商店

kubectl delete ns openpitrix-system

Metrics Server

helm delete metrics-server -n kube-system

事件

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

审计

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

日志

kubectl delete ns kubesphere-logging-system

可选:

# Uninstall es and curator
helm uninstall -n kubesphere-logging-system elasticsearch-logging
helm uninstall -n kubesphere-logging-system elasticsearch-logging-curator

# Uninstall fluent bit operator and fluent bit
kubectl delete -f https://github.com/kubesphere/fluentbit-operator/tree/v0.2.0/manifests/logging-stack
kubectl delete -f https://github.com/kubesphere/fluentbit-operator/tree/v0.2.0/manifests/setup

# Uninstall log sidecar injector
helm uninstall -n kubesphere-logging-system logsidecar-injector

告警和通知

kubectl delete ns kubesphere-alerting-system

仅卸载告警

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

仅卸载通知

kubectl delete deployment -n kubesphere-alerting-system notification-deployment
kubectl delete svc -n kubesphere-alerting-system notification

备注

告警和通知通常同时启用,两者在命名空间 kubesphere-alerting-system 中一起运行。

服务网格

helm -n istio-system delete istio-init
helm -n istio-system delete istio
helm -n istio-system delete jaeger-operator
kubectl delete ns istio-system

DevOps

helm -n kubesphere-devops-system delete ks-jenkins
helm -n kubesphere-devops-system delete uc
# Delete DevOps projects
for devopsproject in `kubectl get devopsprojects -o jsonpath="{.items[*].metadata.name}"`
do
  kubectl patch devopsprojects $devopsproject -p '{"metadata":{"finalizers":null}}' --type=merge
done

for pip in `kubectl get pipeline -A -o jsonpath="{.items[*].metadata.name}"`
do
  kubectl patch pipeline $pip -n `kubectl get pipeline -A | grep $pip | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
done

for s2ibinaries in `kubectl get s2ibinaries -A -o jsonpath="{.items[*].metadata.name}"`
do
  kubectl patch s2ibinaries $s2ibinaries -n `kubectl get s2ibinaries -A | grep $s2ibinaries | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
done

for s2ibuilders in `kubectl get s2ibuilders -A -o jsonpath="{.items[*].metadata.name}"`
do
  kubectl patch s2ibuilders $s2ibuilders -n `kubectl get s2ibuilders -A | grep $s2ibuilders | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
done

for s2ibuildertemplates in `kubectl get s2ibuildertemplates -A -o jsonpath="{.items[*].metadata.name}"`
do
  kubectl patch s2ibuildertemplates $s2ibuildertemplates -n `kubectl get s2ibuildertemplates -A | grep $s2ibuildertemplates | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
done

for s2iruns in `kubectl get s2iruns -A -o jsonpath="{.items[*].metadata.name}"`
do
  kubectl patch s2iruns $s2iruns -n `kubectl get s2iruns -A | grep $s2iruns | awk '{print $1}'` -p '{"metadata":{"finalizers":null}}' --type=merge
done

kubectl delete devopsprojects --all 2>/dev/null
kubectl delete ns kubesphere-devops-system

备注

对于组件 NetworkPolicy,无需卸载组件就能禁用该组件,因为该组件的控制器现在位于 ks-controller-manager 中。若想将组件 NetworkPolicy 从 KubeSphere 的控制台中移除,请在 ks-installer 中将 networkPolicy.enabled 更改为 false