使用cli删除kubernetes服务目录终结器 [英] remove kubernetes service-catalog finalizer with cli

查看:87
本文介绍了使用cli删除kubernetes服务目录终结器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从我的云提供商(IBM云私有)提供/取消提供服务实例/绑定,目前,存在一个错误,即如果未在ICP中取消提供服务,则会使我的孤儿服务实例留在我的计算机上即使使用强制选项也无法删除的ICP环境. 他们提供了以下解决方法:

I'm trying to provision/deprovision service instance/binding from my cloud provider (IBM cloud private), Currently, there is a bug that if the service is not deprovisioned in ICP, that leaves me the orphan service instance on my ICP environment which I can't delete even with force option. They provide a workaround solution of:

kubectl edit ServiceInstance <service-instance-name>
kubectl edit ServiceBinding <service-binding-name>

然后删除该行:

...
finalizers:
    - kubernetes-incubator/service-catalog
...

和孤立服务实例/绑定将被正确删除.我想知道如何使用bash cli(实时编辑+删除行+保存+退出)或任何其他方式来自动化此过程.

and the orphan service instance/binding will get deleted properly. I'm wondering how to automate this process with bash cli (live edit + delete line + save + exit) or any alternative way.

推荐答案

kubectl patch是一种方法.您还可以使用 jq /kubectl oneliner.

kubectl patch is one way. You can also use a jq/kubectl oneliner.

kubectl get ServiceInstance <service-instance-name> -o=json | \
jq '.metadata.finalizers = null' | kubectl apply -f -

这篇关于使用cli删除kubernetes服务目录终结器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆