Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to reload plugin configuration? #198

Closed
sebbonnet opened this issue Apr 22, 2024 · 2 comments
Closed

Question: How to reload plugin configuration? #198

sebbonnet opened this issue Apr 22, 2024 · 2 comments

Comments

@sebbonnet
Copy link

sebbonnet commented Apr 22, 2024

Hi,

I’m writing a custom go plugin to validate scopes in JWT.
The plugin takes the “allowed scopes” for a given path as plugin configuration.
Although the plugin configuration is loaded correctly the first time, subsequent updates to the config are not picked up. Is there a way to rollout config changes or somehow send a signal to the plugin to reload its config?

Besides deleting the KongPlugin configuration CR has no effect either, so it does seem that the plugin configuration is cached for the duration of the plugin server at least.
In fact looking at instance.go, there is a comment suggesting here that a new instance should be started in case of plugin config changes and the old one stopped. Are there any examples/guides on how to do that? How can I retrieve the current instance status to stop the old instance and how to generate a new instance status to start a new one?

I posted this question in the discuss.konghq.com too, but realise this might be more sensible to have it here instead.

I'm using kong docker image 3.6.0-ubuntu and go-pdk v0.11.0
Here is what the custom plugin configuration looks like.

apiVersion: [configuration.konghq.com/v1](http://configuration.konghq.com/v1)
config:
jwksUri: https://some-url/certs
protectedPaths:
- allowedScopes:
- tenant-two-scope
path: /ip
kind: KongPlugin
metadata:
name: hello-oauth2
namespace: kong-tenant-two
plugin: mygoplugin

Many thanks

@gszr
Copy link
Member

gszr commented Apr 23, 2024

Answered in https://discuss.konghq.com/t/how-to-reload-custom-go-plugin-configuration/12582/5. Closing this to avoid duplication.

@gszr gszr closed this as completed Apr 23, 2024
@gszr
Copy link
Member

gszr commented Apr 23, 2024

For reference, the fix for this issue is Kong/kong#12729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants