最近清理k8s环境,删除istio时发现istio-system下有组件删除不掉:
1.查看该namespase下还有什么资源
kubectl api-resources -o name --verbs=list --namespaced | xargs -n 1 kubectl get --show-kind --ignore-not-found -n istio-system
NAME AGE
kiali.kiali.io/kiali 3d21h
2.kiali删除不掉
发现finalizers字段不为空,清空后该crd被清空(确保operator已被删了,并且下达到删除该crd的命令)
ki get kiali -oyaml
...
finalizers:
- kiali.io/finalizer
...
3.istio-system所有的资源被清空,但还是处于Terminating状态
k get ns istio-system -o yaml
...
finalizers:
- kubernetes
...
k edit ns istio-system 清空 finalizers 不成功
kubectl api-resources
error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request
# 删除错误的资源(稍等一会就ns就会删除)
kubectl delete apiservices v1beta1.metrics.k8s.io
网友评论