Support for dynamic loading of Kong custom plugins #9147
Replies: 5 comments 2 replies
-
A restart is not required, a reload will do. If the plugin has a custom DAO, then it would require a migration (DB updates) on the control plane. That's a complication factor. Also a DP needs to know at load time what plugins it has available, otherwise it cannot tell the CP which plugins it supports. Now if the CP holds the plugins and pushes them to the DP, that is something that is on the radar already. |
Beta Was this translation helpful? Give feedback.
-
@Tieske : I'm referring to KIC
[@sanjimoh] With the current design, how does one reload without a restart of the Kong pod(s)? The configmap consisting of the custom plugin code needs to be loaded and enabled which involves changing the Kong deployment manifest and thats going to restart the Kong pods.
[@sanjimoh] CP/DP segregation comes with So, when you said it's on the radar, is it something a work in progress item or its in the backlog and yet to be picked? Could you provide some reference to this item so that I can keep an eye on the same? |
Beta Was this translation helpful? Give feedback.
-
We face same issue when using Kong in Hybrid mode, we have our kong-CP i one aws eks cluster and kong-dp in another aws account and eks cluster. We cannot find an easy way to upgrade our plugins across the kong-DP without restaring the pods, which would serve live traffic and we have different K8S services, we were looking for a way to dynamically load the plugins on the kong-dp from the kong-cp but with no luck so far. There is some minimal information on setting up a kong plugin server, but i cannot find any real documentation for it. Soo Any updates on this issue? |
Beta Was this translation helpful? Give feedback.
-
@sanjimoh, Are you still facing this issue, we are starting the POC now. |
Beta Was this translation helpful? Give feedback.
-
Not in progress, but under consideration. Also a more general note (on the approach by @oxie ); Adding plugins means adding executable code to a container. So rebuilding the image and redeploying is in line with best-practices. This means recreating a new container image, with the custom plugins embedded. No configmaps. If you dynamically change the contents of the container, you're changing behaviour at runtime. This might be flagged in a security audit. |
Beta Was this translation helpful? Give feedback.
-
Context
Based on my understanding of how currently any Kong plugins becomes usable is actually 2 step process -
1. Load Phase
2. Enable Phase
The existing way, in Kubernetes world, for achieving above is by -
Configmap
with custom plugin code in the Kong’s namespaceKONG_PLUGINS
env to load this plugin.Concern
OOB plugins or Kong bundled plugins are already loaded during the Kong bootstrapping because these are pre-bundled. However, the custom plugins are unknown to Kong instances; hence these requires to be loaded first which involves a restart of Kong instances.
This approach could be tricky in -
Request
I was looking for a classical dynamic loading behaviour, wherein all that is required is to externalise the custom plugins onto some location (local/remote/url) already known to the running Kong instance. Kong looks for & lazily loads this plugin upon certain trigger (ex. during enabling phase of the custom plugin) without anyone requiring a need to provide the plugin name/details every time there is a new custom plugin. Hence, no restart of Kong instances would be required and would really help addressing the other concerns I had indicated earlier.
Curious to hear out what do you think about this?
Beta Was this translation helpful? Give feedback.
All reactions