解决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/ 目录下

相关推荐
三朝看客5 天前
BClinux docker安装kong和konga
docker·容器·kong
爱技术的小伙子1 个月前
【API网关】 使用Kong、Zuul等工具实现API网关
kong
博客威3 个月前
kong网关部署
kong·konga
明明在学JAVA3 个月前
Kong网关的负载均衡
python·负载均衡·kong
Wang's Blog4 个月前
Go微服务: 基于Docker搭建Kong网关环境
docker·微服务·golang·kong
明明在学JAVA4 个月前
Kong网关身份认证
kong
宫孙小兔4 个月前
Kong网关代理MQTT的两种方法
nginx·kong·tcp·代理·流代理
天草二十六_简村人5 个月前
API网关工具Kong或nginx ingress实现对客户端IP的白名单限制,提高对外服务的访问安全
运维·nginx·安全·kubernetes·k8s·kong
叱咤少帅(少帅)6 个月前
Kong基于QPS、IP限流
kong
天草二十六_简村人6 个月前
Php和h5等静态文件的服务容器化部署(下)
阿里云·ci/cd·云原生·php·kong·html5