Hi!
I was playing with the new global plugin support and at this moment it’s not possible to configure a “global” consumer for plugins like rate-limiting, request-size-limiting, etc.
What I did to solve this, I modified the code to support this. You could check the snippet here
But having a “global” with consumer doesn’t fit for me. Because if we read the definition of the global plugin from the documentation said “A plugin which is not associated to any Service, Route or Consumer (or API, if you are using an older version of Kong) is considered “global”, and will be run on every request.” If we take that statement having a label called global: “true” it’s not necessary because could be inferred from a CRD like this
I think that we need to be closer to the actual documentation. I don’t know what is the best option. I’ve some ideas like always create a global plugin (if its possible) when we create the CRD and if the user doesn’t want it, he needs to be explicit like global: “false” I know that looks similar to the actual behavior but it’s closer to the actual definition. And other option could have a new CRD called KongGlobalPlugin that will work in global and consumer level and the services, route, and consumer wil be handled by the KongPlugin, and another option maybe is resolve this in the code directly only with one CRD and adding subresource to show to the user if the KongPlugin is running in global mode, adding properties like plugin name, some config, and status but that only will work on 1.11.
I opened this topic to start a discussion and also to understand the approach that you guys are looking for.
Kind Regards!