Hi, I am new to Kong. I setup a Kong Docker and it works well (Try Official 5 minutes tutorial)
Then, I try to install custom plugin : GitHub - brndmg/kong-plugin-hello-world: A hello world example plugin for the Kong API Gateway
Step A
- Git Clone
- luarocks make
- luarocks pack kong-plugin-hello-world 0.1-1
- luarocks install kong-plugin-hello-world
Step B: Load hello world plugin into Kong
Try 1: Modify /etc/kong/kong.conf.default by adding custom_plugins = kong-plugin-hello-world
Try 2. Add kong.yml to /etc/kong/ and
adding
custom_plugins:
- kong-plugin-hello-world
Try 3. Adding “export KONG_CUSTOM_PLUGINS=kong-plugin-hello-world” to .bashrc,
All the trial on Step B will restart Kong docker, but no one of them can load the plugin.
Anyone can help?
Hi Steven,
I’m currently facing the same issue. Did manage to get around this?
I’m on 1.2 and I used the environment variable KONG_PLUGINS
. Be sure to include bundled,kong-plugin-hello-world
. If you leave out bundled
, it will only load the hello-world plugin. Are you getting any error such as plugin is enabled but not installed
?
All I had to do is set that env and luarocks install and it showed
All sorted now. Thanks @bskiefer!
1 Like
Hi @Steven_LO ,
I am too late to answer your query, however I want to get this documented for others who face the same issue. Hence, commenting my response as below:
You have to set below mentioned two environment variables either in your docker file or through export command of linux:
KONG_LUA_PACKAGE_PATH="/usr/local/kong/custom/?.lua;;"
KONG_PLUGINS="bundled, MY_CUSTOM_PLUGIN"
After this, just restart the Kong gateway
docker exec -it KONG_CONTAINER_ID_OR_NAME
kong restart