当命名空间删除卡住时,如何找到特定的 Kubernetes 资源并“终止/完成”它?

当命名空间删除卡住时,如何找到特定的 Kubernetes 资源并“终止/完成”它?

嗨,我试图删除一些命名空间,但它们卡在终止状态......

从以下详细信息中,我尝试删除假定的角色绑定和角色,但它们也不会删除,而且我不知道在哪里可以找到以下资源:wrangler.cattle.io/auth-prov-v2-rb 和 wrangler.cattle.io/auth-prov-v2-role

  conditions:
  - lastTransitionTime: "2023-08-09T21:30:18Z"
    message: All resources successfully discovered
    reason: ResourcesDiscovered
    status: "False"
    type: NamespaceDeletionDiscoveryFailure
  - lastTransitionTime: "2023-08-09T21:30:18Z"
    message: All legacy kube types successfully parsed
    reason: ParsedGroupVersions
    status: "False"
    type: NamespaceDeletionGroupVersionParsingFailure
  - lastTransitionTime: "2023-08-09T21:30:18Z"
    message: All content successfully deleted, may be waiting on finalization
    reason: ContentDeleted
    status: "False"
    type: NamespaceDeletionContentFailure
  - lastTransitionTime: "2023-08-09T21:30:18Z"
    message: 'Some resources are remaining: rolebindings.rbac.authorization.k8s.io
      has 2 resource instances, roles.rbac.authorization.k8s.io has 1 resource instances'
    reason: SomeResourcesRemain
    status: "True"
    type: NamespaceContentRemaining
  - lastTransitionTime: "2023-08-09T21:30:18Z"
    message: 'Some content in the namespace has finalizers remaining: wrangler.cattle.io/auth-prov-v2-rb
      in 2 resource instances, wrangler.cattle.io/auth-prov-v2-role in 1 resource
      instances'
    reason: SomeFinalizersRemain
    status: "True"
    type: NamespaceFinalizersRemaining

答案1

有一堆资源:角色、角色绑定(+集群)和自定义资源,它们都有终结器,也无法删除。因此,我通过删除终结器修补了所有这些资源,一切最终都开始自行删除。

相关内容