解决kong部署自定义插件报 helloworld plugin is enabled but not installed

背景

我使用的是docker环境部署,使用的是自定义挂载plugins路径

bash 复制代码
-e "KONG_LUA_PACKAGE_PATH=/plugins/?.lua" \
-v "/plugins:/plugins" \
-e "KONG_PLUGINS=bundled,helloworld" \

但是当我只需docker run的时候就报错

复制代码
 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:592: error loading plugin schemas: on plugin 'helloworld': helloworld plugin is enabled but not installed;
no plugin found
stack traceback:
        [C]: in function 'assert'
        /usr/local/share/lua/5.1/kong/init.lua:592: in function 'init'
        init_by_lua:3: in main chunk
nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:592: error loading plugin schemas: on plugin 'helloworld': helloworld plugin is enabled but not installed;
no plugin found
stack traceback:
        [C]: in function 'assert'
        /usr/local/share/lua/5.1/kong/init.lua:592: in function 'init'
        init_by_lua:3: in main chunk



curl -i -X PATCH --url http://localhost:8001/plugins/demo --data "config.position=1"

如何解决

  • 是因为挂的是到 plugins目录,我当时是直接报 handler.lua和schema.lua放在了 plugins目录下面了,不能这么放,应该建个目录

    mkdir -p /plugins/kong/plugins/helloworld

然后把 lua文件放在 /plugins/kong/plugins/helloworld/ 目录下

相关推荐
JohnGox5 天前
KONG根据请求参数限流
kong·限流
星释5 天前
使用API网关Kong配置反向代理和负载均衡
运维·负载均衡·kong
莱茵不哈哈21 天前
OpenResty 深度解析:构建高性能 Web 服务的终极方案
nginx·lua·kong·openresty·conf
泽济天下21 天前
【工作记录】Kong Gateway入门篇之简介
gateway·kong
泽济天下24 天前
【工作记录】Kong Gateway 入门篇之部署及简单测试
gateway·kong
yunson_Liu1 个月前
Helm部署kong+konga的路由管理系统
kong
long_21451 个月前
基于k8s系统的API网关-kong网关
kubernetes·kong·api网关
A叶子叶2 个月前
Kong网关部署研究
python·spring cloud·微服务·gateway·kong
观测云2 个月前
Kong 可观测性最佳实践
kong
天草二十六_简村人2 个月前
微信小程序的业务域名配置(通过ingress网关的注解)
后端·微服务·微信小程序·小程序·k8s·kong