强制删除rook-ceph的namespace

最近操作失误,发现rook-ceph的namespace无法删除,就开启一波强制操作

1、查看rook-ceph空间

# kubectl get ns

2、查看nsmespace中的finalizers字段值

# kubectl get namespaces rook-ceph -o yaml

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

3、导出rook-ceph的json文件

# kubectl get namespaces rook-ceph -o json > rook-ceph.json

4、编辑rook-ceph.json删除finalizers的值

# vim rook-ceph.json

"spec": { "finalizers": [ - kubernetes ] },
改为
"spec": { "finalizers": [ ] },

5、另起一个命令行,开启proxy

# kubectl proxy

6、执行强制删除命令

# curl -k -H “Content-Type: application/json” -X PUT –data-binary @rook-ceph.json http://127.0.0.1:8001/api/v1/namespaces/rook-ceph.json/finalize

7、查看现在的ns

# kubectl get ns

强制删除干净了

6 评论

  1. I really like your blog.. very nice colors & theme.
    Did you make this website yourself or did you hire someone to
    do it for you? Plz reply as I’m looking to design my own blog and
    would like to find out where u got this from. thanks a lot

  2. Greetings! I know this is kinda off topic but I’d figured
    I’d ask. Would you be interested in trading links or maybe guest
    authoring a blog article or vice-versa? My website discusses a lot of the same subjects
    as yours and I feel we could greatly benefit from each other.

    If you happen to be interested feel free to send me an e-mail.
    I look forward to hearing from you! Fantastic blog by
    the way!

  3. Hi! This is my first comment here so I just wanted to give a quick shout out and tell
    you I truly enjoy reading through your posts. Can you recommend
    any other blogs/websites/forums that cover the same topics?
    Appreciate it!

  4. Howdy I am so delighted I found your web site,
    I really found you by accident, while I was
    looking on Askjeeve for something else, Anyhow I am here now and would just like to say thanks for a remarkable post and a all round
    entertaining blog (I also love the theme/design), I don’t have
    time to read through it all at the minute but I have book-marked it
    and also added your RSS feeds, so when I have time I will be back to read more, Please
    do keep up the excellent work.

留下评论

error: Content is protected !!