Kong之kong-dashboard 管控台-yellowcong
Kong 里面现在主要有两个开源得web框架,一个是kongga,我觉得这个比较得好,另外一个是kong-dashboard ,这个得功能就相当于少了不少了。 这个dashboard是基于 nodejs开发的,所以开发的时候,需要搭建好nodejs的环境,我们这一章节,先讲解如何开发使用 kong-dashbord
1 kong-dashboard
1.1 npm方式安装
1.1.1 安装nodejs
yum install -y epel-release nodejs
#查看版本
node --version
好了,安装成功了。
#安装npm
yum install npm --enablerepo=epel
#再然后express
npm install -g express
#express-generator
npm install -g express-generator
1.1.2 安装 kong dashboard
版本匹配信息
#安装kong-dashboard
npm install -g kong-dashboard
#安装指定的版本,后面加上@版本
npm install -g kong-dashboard@3.5.x
#启动 Kong Dashboard
#默认端口是 8080
kong-dashboard start --kong-url http://kong:8001
#后台启动的方式
nohup kong-dashboard start --kong-url http://127.0.0.1:8001 >/dev/null 2>&1 &
# 启动 Kong Dashboard 在一个指定的端口
kong-dashboard start \
--kong-url http://kong:8001 \
--port [port]
# 启动 Kong Dashboard 带一个简单授权
kong-dashboard start \
--kong-url http://kong:8001 \
--basic-auth user1=password1 user2=password2
#后台挂起启动
#简单的添加几个用户的数据
nohup kong-dashboard start --kong-url http://127.0.0.1:8001 --basic-auth admin=yellowcong user2=password2 >/dev/null 2>&1 &
# 看 dashbord的命令参数
kong-dashboard start --help
后台启动kong-dashbord,如果不指定端口,就会默认指定为 8080端口
指定命令的方式启动
2 docker方式安装
# Start Kong Dashboard
docker run --rm -p 8080:8080 pgbi/kong-dashboard start --kong-url http://kong:8001
# Start Kong Dashboard on a custom port
docker run --rm -p [port]:8080 pgbi/kong-dashboard start --kong-url http://kong:8001
# Start Kong Dashboard with basic auth
docker run --rm -p 8080:8080 pgbi/kong-dashboard start \
--kong-url http://kong:8001
--basic-auth user1=password1 user2=password2
# See full list of start options
docker run --rm -p 8080:8080 pgbi/kong-dashboard start --help
参考文章
https://www.linzepeng.com/2018/06/22/kong-dashboard-note/
https://www.npmjs.com/package/kong-dashboard
还没有评论,来说两句吧...