Defined Ingress and can access my API, checked Postgres routes table and can see the route is there.
I wanted to define global KongPlugin and then to use it via annotations in my Ingress but the plugin is not defined, there is no plugin in plugins table and no plugin in via the admin api.
@hbagdi Hello,
Thank you for you answer.
I used the global : "true" nested under labels as you suggested, indentation probably was broke when I pasted the yaml here.
But still, the plugin is not available.
@hbagdi This is my Kong Ingress Version:
-------------------------------------------------------------------------------
Kong Ingress controller
Release: 0.2.0
Build: git-de9e38c6
Repository: git@github.com:Kong/kubernetes-ingress-controller.git
This is the error I see in the Kong Ingress controller pod log:
I’d assumed that the key: value was an actual config but the first error log seems to indicate that you had put in the key: value part in the YAML as is.
The request fails without the config because IP restrictions plugin, as per the docs, needs a bare minimum config and won’t work without a config.
@hbagdi thank you, this way the plugin is deployed.
In our current deployment we have ip-restriction plugin per API.
The question is if I config whitlist in KongPlugin like you suggested it will effect all Ingresses?
How I deploy ip-restriction plugin per API with different whitelist/blacklist configs in each API ?
Actually what I am asking is how to set the plugin config for each Ingress independently from the KongPlugin config ?
You can create KongPlugin resources without the global : "true" label. This will actually not create a plugin in Kong.
Then you associate the plugin with the Ingress using the plugins.konghq.com annotation. This will create the plugin on the Route corresponding to your Ingress. This let’s you finely control which plugins run on each Ingress.
This was the missing part (:
Then last question, I deployed Kongplugin and KongIngress, how do I use the configuration.konghq.com annotation properly.
How to set config in Ingress for the plugin?
How to associate config to plugin , for example if I have few plugins used with one Ingress , let’s say ip-restriction and udp-logs.
configuration.konghq.com annotation is used to associate a KongIngress resource with an Ingress resource. It has nothing to do with a plugin.
You define configs for the plugins in the KongPlugin custom resource under the config property.
Also, a global plugin (KongPlugin with a label global: "true") doesn’t need to be applied at the Ingress level, it will be applied for every request that is proxied via Kong.