如何在Kubernetes中删除(删除)注释 [英] How to remove (delete) annotation in Kubernetes

查看:71
本文介绍了如何在Kubernetes中删除(删除)注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Kubernetes中删除注释的方式与kubectl edit是否不同?

Is there a different way than kubectl edit to delete an annotation in Kubernetes?

我不喜欢kubectl edit的交互性.我更喜欢脚本中可用的东西.

I do not like the interactivity of kubectl edit. I prefer something usable in a script.

推荐答案

kubectl annotate中注释的末尾使用减号-.

Use minus - sign at the end of the annotation in kubectl annotate.

示例:

kubectl annotate service shopping-cart prometheus.io/scrape-

shopping-cart服务中删除注释prometheus.io/scrape.

这篇关于如何在Kubernetes中删除(删除)注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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