LoginSignup
3
1

More than 3 years have passed since last update.

K8s namespaceを削除できず、待機中まま

Last updated at Posted at 2020-10-30

時々namespaceを削除できず、待機中ままの問題が発生するでしょうか?
解決方法をご紹介致します。

$ kubectl delete namespaces argo-events
namespace "argo-events" deleted
...
(待機中状態ままとなっています)

まず、namespaceの現状をJsonに出力します。この例は、argo-eventsのnamespaceとなります。

kubectl get namespace argo-events -o json > ~/argo-events.json

argo-events.jsonファイルを開いて、finalizersの中にkubernetesを削除します。

    "spec": {
        "finalizers": [
            "kubernetes"
        ]
    },

↓(kubernetesを削除します)

    "spec": {
        "finalizers": [
        ]
    },

それから、namespaceに反映します。

kubectl replace --raw "/api/v1/namespaces/argo-events/finalize" -f ~/argo-events.json

これを実行したら、最初のnamespace削除コマンドが進まれて、削除できるようになります。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1