从 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
。
当前内容版权归 KubeSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 KubeSphere .