0

I am trying to load a custom plugin in Kong. I installed the plugin using luarocks make which gave me an output kong-circuit-breaker 1.0.4-1 is now installed in /usr/local (license: MIT) . Now if I try to restart my kong docker container and then restart kong, Kong runs successfully but this plugin is not loaded. After being stuck here for pretty long time I started setting the env variable of my Kong container, KONG_PLUGINS=bundled,kong-circuit-breaker and now the kong container fails to run everytime with a msg plugin is enabled but not installed. I even tried setting LUA_PACKAGE_PATH environment variable of my kong container to point to my plugin directories but of no use. Any idea why this is happenning and how can I successfully load custom plugins in my Kong?

1 Answers1

1

you should not put kong- in the plugin name.

this should be:

KONG_PLUGINS=bundled,circuit-breaker

Kong will look for kong.plugins.YOURPLUGIN thats why you should not put kong-

Ôrel
  • 7,044
  • 3
  • 27
  • 46
  • Thanks @Orel for the hint... atleast I have changed my error. When I am saying kong start in pongo shell.... I am seeing below error.... can you please assist here. Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:75: /usr/local/share/lua/5.1/kong/cmd/start.lua:64: nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:515: error loading plugin schemas: on plugin 'check-x-header': check-x-header plugin is enabled but not installed; no plugin found – Jaikrat Sep 07 '21 at 07:50
  • stack traceback: [C]: in function 'assert' /usr/local/share/lua/5.1/kong/init.lua:515: in function 'init' init_by_lua:3: in main chunk stack traceback: [C]: in function 'error' /usr/local/share/lua/5.1/kong/cmd/start.lua:75: in function 'cmd_exec' /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function [C]: in function 'xpcall' /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function – Jaikrat Sep 07 '21 at 07:51
  • /kong/bin/kong:9: in function 'file_gen' init_worker_by_lua:47: in function – Jaikrat Sep 07 '21 at 07:51
  • Perhaps open another question. The message is quite clear you didn't install the `check-x-header` plugin – Ôrel Sep 07 '21 at 09:16
  • Here it is... Thanks.... https://stackoverflow.com/questions/69085647/how-to-install-custom-plugin-in-locally-setup-kong – Jaikrat Sep 07 '21 at 09:28