When is the Kong Plugin take effect?


#1

I find that the plugins which install after Kong started will not take effect or discovered by kong until Kong is restarted.
Even you reload Kong several times after modify Kong.conf.
Is there any solution to add some new plugins in Kong that will not stop Kong server?

My Version in Kong is 0.14


#2

I’d like to clarify and understand the issue at hand more clearly.

I’m assuming you by installing, you mean installing a Kong plugin as a Luarock in the file-system and then updating kong.conf (plugins property) to use that. Is that what you mean?

What does not take effect exactly mean here?


#3

Yeah, that’s right.

First, I’m installing Kong with rpm.

sudo yum install kong-community-edition-1.0.0.*.noarch.rpm --nogpgcheck

And then install a Kong plugin by luarocks.

luarocks install <rock-filename>

The rock-file is generated by pack it:

luarocks pack <plugin-name> <version>

Util now, everything goes fine, plugin install success.
And then modify the conf in /etc/conf/kong.conf (this file is copied from the kong.conf.default)

plugins = bundled, XXXX-custom-plugin

Save that conf and use this:

kong reload

After that the XXXX-custom-plugin will nerver show in the plugins. (I’m using a third-party admin-gui Admin-gui).
Even I grep the url will get nothing:

curl http://localhost:8001 | grep XXXX-custom-plugin

That’s imply the XXXX-custom-plugin is not taking effect, right?

But, XXXX-custom-plugin take effect after I use this command:

kong restart

But this command will cause kong stop(which I’m not expecting).

Is there any solution to avoid that?


#4

Could you try doing the following instead of only doing kong reload?

kong prepare
kong reload

Kong reload under some settings, doesn’t read and apply the kong.conf setting.


#5

Wow, That’s it !
Thanks for your help.