查看命名空间列表:
kubectl get ns

NAME               STATUS        AGE
default            Active        87d
dev                Active        21d
ingress-nginx      Active        126m
keda               Terminating   126m
kube-flannel       Active        87d
kube-node-lease    Active        87d
kube-public        Active        87d
kube-system        Active        87d
openfaas           Active        87d
openfaas-fn        Active        87d
openfunction       Active        28h
tekton-pipelines   Active        126m
将无法删除命名空间的json格式配置文件导出:
kubectl get ns keda -o json > keda.json
编辑json配置文件的"spec"配置,将"finalizers"清空:
    "spec": {
        "finalizers": [
        ]
    },
根据修改后的json配置replace掉原来的ns配置:
kubectl replace --raw "/api/v1/namespaces/keda/finalize" -f ./keda.json
再度查看:
kubectl get ns

NAME               STATUS   AGE
default            Active   87d
dev                Active   21d
ingress-nginx      Active   144m
kube-flannel       Active   87d
kube-node-lease    Active   87d
kube-public        Active   87d
kube-system        Active   87d
openfaas           Active   87d
openfaas-fn        Active   87d
openfunction       Active   28h
tekton-pipelines   Active   144m
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐