Karena alasan tertentu mungkin ada ingin menghapus namespace kubesphere-logging-system, yang merupakan bagian dari kubesphere. Karena ada beberapa resource/object yang menggunakan finalizer, sehingga tidak bisa langsung dihapus. Mari kita mulai dengan menghapus namespace tersebut

kubectl delete ns/kubesphere-logging-system

Pada beberapa kasus menghapus finalizer di namespace kubesphere-logging-system, bisa langsung menghapus namespace tersebut

kubectl edit ns/kubesphere-logging-system

cari bagian finalizers, lalu hapus baris tersebut. Bila masih belum bisa menghapus namespace tersebut, lanjutkan tutorialnya :D

Setelah 1 jam, namespace tersebut tetap dalam proses Terminating

➜  ~ kubectl describe ns/kubesphere-logging-system
Name:         kubesphere-logging-system
Labels:       kubesphere.io/namespace=kubesphere-logging-system
              kubesphere.io/workspace=system-workspace
Annotations:  <none>
Status:       Terminating
Conditions:
  Type                                         Status  LastTransitionTime               Reason                Message
  ----                                         ------  ------------------               ------                -------
  NamespaceDeletionDiscoveryFailure            False   Sun, 13 Nov 2022 22:02:34 +0700  ResourcesDiscovered   All resources successfully discovered
  NamespaceDeletionGroupVersionParsingFailure  False   Sun, 13 Nov 2022 22:02:34 +0700  ParsedGroupVersions   All legacy kube types successfully parsed
  NamespaceDeletionContentFailure              False   Sun, 13 Nov 2022 22:02:34 +0700  ContentDeleted        All content successfully deleted, may be waiting on finalization
  NamespaceContentRemaining                    True    Sun, 13 Nov 2022 22:02:34 +0700  SomeResourcesRemain   Some resources are remaining: fluentbits.logging.kubesphere.io has 1 resource instances
  NamespaceFinalizersRemaining                 True    Sun, 13 Nov 2022 22:02:34 +0700  SomeFinalizersRemain  Some content in the namespace has finalizers remaining: fluentbit.logging.kubesphere.io in 1 resource instances
 
No resource quota.
 
No LimitRange resource.

Bila dari informasi diatas ada resource yang nyangkut, edit resource tersebut dengan

kubectl edit fluentbit.logging.kubesphere.io -n kubesphere-logging-system

lalu hapus bagian

  finalizers:
  - fluentbit.logging.kubesphere.io

simpan, lalu cek status namespace kubesphere-logging-system

kubectl get ns kubesphere-logging-system
Error from server (NotFound): namespaces "kubesphere-logging-system" not found

Leave a comment

Your email address will not be published. Required fields are marked *