You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Kong Ingress Controller:如何从服务配置中移除插件?

移除Kong Kubernetes Ingress Controller中服务插件的正确方式

快捷核心操作:用kubectl annotate删除插件注解

如果你的插件是通过给Service添加konghq.com/plugins注解的方式配置的,最直接高效的方式就是执行以下命令移除该注解:

kubectl annotate service <service-name> konghq.com/plugins-

命令末尾的-是Kubernetes中删除指定注解的标准语法,无需手动编辑配置文件。

不同插件配置场景的处理

  • 若插件是通过独立KongPlugin资源绑定到Service的:
    1. 先确认Service关联的插件:
      kubectl get service <service-name> -o yaml | grep konghq.com/plugins
      
    2. 要么用上述annotate命令删除Service上的绑定注解,要么直接删除对应的KongPlugin资源:
      kubectl delete kongplugin <plugin-name>
      
  • 要是插件绑定在Ingress资源上,同理移除Ingress的konghq.com/plugins注解即可。

为什么不推荐kubectl edit?

kubectl edit需要手动修改YAML配置,不仅操作繁琐,还容易因误编辑引发配置错误,而annotate命令是针对注解的精准操作,更适合快速修改和自动化场景。

内容的提问来源于stack exchange,提问作者mikyll98

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 16:33:09