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

相关推荐
摇滚侠20 天前
Kong API 列表加 curl 访问案例 通过 curl 修改 router 的 method
java·kong
计算机小手1 个月前
Kong + Konga 网关入门实践:Docker 部署、反向代理与插件使用指南
运维·经验分享·网络协议·docker·kong·开源软件
摇滚侠1 个月前
VMvare 虚拟机 centOS 7 安装 Docker,Docker 安装 Kong Konga
docker·centos·kong
小毅&Nora2 个月前
【后端】【诡秘架构】 序列7:魔术师 - API网关与协议转换的艺术:用Kong编织系统的幻象
架构·kong
2401_860494702 个月前
如何在React Native中,开发一个类似于鸿蒙组件(Hong Kong component)的NoticeBar(通知栏)组件呢?
javascript·react native·react.js·ecmascript·kong·harmonyos
n***29322 个月前
后端API网关教程,Kong与APISIX
kong
青鱼入云3 个月前
对比nginx、kong、apisix、zuul、gateway网关
nginx·gateway·kong
无名小卒20224 个月前
{人工智能}未来十年改变世界的核心技术驱动力
kong
William一直在路上4 个月前
Kong Gateway 实操实例:代理上游服务并配置限流插件
gateway·kong
tnan25226 个月前
记录docker使用kong consul postgresql配置dns异常解决
docker·kong·consul