1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| # 删除 Rancher 依赖的 namespace 出现报错 Error from server (Forbidden): error when creating "STDIN": serviceaccounts "cattle" is forbidden: unable to create new content in namespace cattle-system because it is being terminated Error from server (Forbidden): error when creating "STDIN": secrets "cattle-credentials-855d8e8" is forbidden: unable to create new content in namespace cattle-system because it is being terminated Error from server (Forbidden): error when creating "STDIN": deployments.apps "cattle-cluster-agent" is forbidden: unable to create new content in namespace cattle-system because it is being terminated Error from server (Forbidden): error when creating "STDIN": daemonsets.apps "cattle-node-agent" is forbidden: unable to create new content in namespace cattle-system because it is being terminated
# 解决办法: kubectl patch namespace cattle-system -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system kubectl delete namespace cattle-system --grace-period=0 --force kubectl patch namespace cattle-global-data -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system kubectl delete namespace cattle-global-data --grace-period=0 --force kubectl patch namespace local -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system for resource in `kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get -o name -n local`; do kubectl patch $resource -p '{"metadata": {"finalizers": []}}' --type='merge' -n local; done kubectl delete namespace local --grace-period=0 --force
# 重新将集群加入 Rancher 中
|