kubernetesapi-gatewaykong

Kong Ingress Controller: How to remove a plugin entry from a configuration?


I'm learning Kong API Gateway, and I'm trying to configure it using the Kubernetes Ingress Controller.

I've been able to add a service plugin, following this tutorial, but I cannot find anywhere how to remove it.

I searched it on ChatGPT and I've been able to edit the configuration with kubectl edit service <service_name> command, but it seems a little inconvenient and it feels like it's the wrong way to do it.

Question

What's the correct (simplest and quickest) way to remove a plugin from the configuration of a service? Perhaps using kubectl annotate command? Links to any useful documentation will be widely appreciated :)


Solution

  • When applying a plugin using CRDs, It's just a generic Kubernetes object. Afterward, we can use annotation to annotate a service to have Kong apply said plugin to the service.
    If you want to disable a plugin from a service, remove the konghq.com/plugins annotation.
    To easily remove the annotation, just run kubectl annotate service <service-name> konghq.com/plugins-. Using - after the annotation name will just remove it from the service.