简体   繁体   English

删除处于“终止”状态的链接器 kubernetes 命名空间

[英]Delete linkerd kubernetes namespace in “terminating” status

This is the resource status:这是资源状态:

kind: Namespace
api
Version: v1
metadata:
  name: linkerd
  selfLink: /api/v1/namespaces/linkerd
  uid: e7337b2b-bddb-4344-a986-d450973bc8cf
  resourceVersion: '5540346'
  creationTimestamp: '2020-05-10T13:49:21Z'
  deletionTimestamp: '2020-06-03T20:16:30Z'
  labels:
    config.linkerd.io/admission-webhooks: disabled
    linkerd.io/is-control-plane: 'true'
spec:
  finalizers:
    - kubernetes
status:
  phase: Terminating
  conditions:
    - type: NamespaceDeletionDiscoveryFailure
      status: 'True'
      lastTransitionTime: '2020-06-03T20:16:44Z'
      reason: DiscoveryFailed
      message: >-
        Discovery failed for some groups, 1 failing: unable to retrieve the
        complete list of server APIs: tap.linkerd.io/v1alpha1: the server is
        currently unable to handle the request
    - type: NamespaceDeletionGroupVersionParsingFailure
      status: 'False'
      lastTransitionTime: '2020-06-03T20:16:38Z'
      reason: ParsedGroupVersions
      message: All legacy kube types successfully parsed
    - type: NamespaceDeletionContentFailure
      status: 'False'
      lastTransitionTime: '2020-06-03T20:16:38Z'
      reason: ContentDeleted
      message: 'All content successfully deleted, may be waiting on finalization'
    - type: NamespaceContentRemaining
      status: 'False'
      lastTransitionTime: '2020-06-03T20:16:57Z'
      reason: ContentRemoved
      message: All content successfully removed
    - type: NamespaceFinalizersRemaining
      status: 'False'
      lastTransitionTime: '2020-06-03T20:16:38Z'
      reason: ContentHasNoFinalizers
      message: All content-preserving finalizers finished

Apiservices: API服务:

$ kubectl get apiservice

NAME                                   SERVICE               AVAILABLE                 AGE
v1.                                    Local                 True                      28d
v1.admissionregistration.k8s.io        Local                 True                      28d
v1.apiextensions.k8s.io                Local                 True                      28d
v1.apps                                Local                 True                      28d
v1.authentication.k8s.io               Local                 True                      28d
v1.authorization.k8s.io                Local                 True                      28d
v1.autoscaling                         Local                 True                      28d
v1.batch                               Local                 True                      28d
v1.coordination.k8s.io                 Local                 True                      28d
v1.networking.k8s.io                   Local                 True                      28d
v1.rbac.authorization.k8s.io           Local                 True                      28d
v1.scheduling.k8s.io                   Local                 True                      28d
v1.storage.k8s.io                      Local                 True                      28d
v1alpha1.linkerd.io                    Local                 True                      18d
v1alpha1.snapshot.storage.k8s.io       Local                 True                      28d
v1alpha1.split.smi-spec.io             Local                 True                      18d
v1alpha1.tap.linkerd.io                linkerd/linkerd-tap   False (ServiceNotFound)   24d
v1alpha2.acme.cert-manager.io          Local                 True                      18d
v1alpha2.cert-manager.io               Local                 True                      18d
v1alpha2.linkerd.io                    Local                 True                      18d
v1beta1.admissionregistration.k8s.io   Local                 True                      28d
v1beta1.apiextensions.k8s.io           Local                 True                      28d
v1beta1.authentication.k8s.io          Local                 True                      28d
v1beta1.authorization.k8s.io           Local                 True                      28d
v1beta1.batch                          Local                 True                      28d
v1beta1.certificates.k8s.io            Local                 True                      28d
v1beta1.coordination.k8s.io            Local                 True                      28d
v1beta1.discovery.k8s.io               Local                 True                      18d
v1beta1.events.k8s.io                  Local                 True                      28d
v1beta1.extensions                     Local                 True                      28d
v1beta1.networking.k8s.io              Local                 True                      28d
v1beta1.node.k8s.io                    Local                 True                      28d
v1beta1.policy                         Local                 True                      28d
v1beta1.rbac.authorization.k8s.io      Local                 True                      28d
v1beta1.scheduling.k8s.io              Local                 True                      28d
v1beta1.storage.k8s.io                 Local                 True                      28d
v2.cilium.io                           Local                 True                      18d
v2beta1.autoscaling                    Local                 True                      28d
v2beta2.autoscaling                    Local                 True                      28d

I tried deleting the finalizer, did nothing.我尝试删除终结器,什么也没做。 Also tried to delete with --grace-period=0 --force still nothing.还尝试使用--grace-period=0 --force删除仍然没有。 It does not display any resources under the namespace.它不显示命名空间下的任何资源。

Anything other I can do to force the delete?我还能做些什么来强制删除?

The error you experience is caused by the apiservice v1alpha1.tap.linkerd.io which is not working ( ServiceNotFound ).您遇到的错误是由不起作用的 apiservice v1alpha1.tap.linkerd.io引起的( ServiceNotFound )。 It is hard to say what have caused it but I can see two ways out of it:很难说是什么原因造成的,但我可以看到两种方法:

  1. If you don't need that API than simply delete it: kubectl delete apiservice v1alpha1.tap.linkerd.io .如果您不需要 API 而不是简单地删除它: kubectl delete apiservice v1alpha1.tap.linkerd.io

  2. If you need it, you can try to delete pods related to it in order to restart them and see if that helps.如果需要,可以尝试删除与其相关的 pod 以重新启动它们,看看是否有帮助。

After that you should be able to delete the namespace you mentioned.之后,您应该能够删除您提到的命名空间。

Please let me know if that helps.请让我知道这是否有帮助。

You can run linkerd uninstall | kubectl delete -f -您可以运行linkerd uninstall | kubectl delete -f - linkerd uninstall | kubectl delete -f - and it will delete the resources in the right order so this error doesn't occur. linkerd uninstall | kubectl delete -f -它将以正确的顺序删除资源,因此不会发生此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM