5

Kong Gateway (1.2.0) 安装

 1 year ago
source link: https://www.jansora.com/notebook/107601
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

安装 kong

首先需要一个安装好的 postgreSQL 10+

docker pull kong:1.2.0

初始化 kong 数据库脚本

请替换你自己的数据库配置

docker run --rm \
     -e "KONG_DATABASE=postgres" \
     -e "KONG_PG_HOST=127.0.0.1" \
     -e "KONG_PG_USER=kong" \
     -e "KONG_PG_PORT=5432" \
     -e "KONG_PG_PASSWORD=kong" \
     kong:1.2.0 kong migrations bootstrap

启动 kong

docker run -d --name kong \
     -e "KONG_DATABASE=postgres" \
     -e "KONG_PG_HOST=127.0.0.1" \
     -e "KONG_PG_USER=kong" \
     -e "KONG_PG_PORT=5432" \
     -e "KONG_PG_PASSWORD=kong" \
     -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
     -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
     -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
     -e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
     -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
     -e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
     -p 58000:8000 \
     -p 58443:8443 \
     -p 58001:8001 \
     -p 58444:8444 \
     kong:1.2.0

安装 Konga

docker pull pantsel/konga:0.14.9

初始化配置

docker run --rm pantsel/konga:0.14.9 -c prepare -a postgres -u postgresql://kong:xxx@localhost:55432/kong

网络要使用 host 模式

 docker run -d --name konga  -e "DB_ADAPTER=postgres"  -e "DB_HOST=localhost"  -e "DB_PORT=55432"  -e "DB_USER=kong"  -e "DB_PASSWORD=xxx"  -e "DB_DATABASE=kong"  -e "DB_PG_SCHEMA=public"  -e "NODE_ENV=production"  -p 1337:1337 pantsel/konga:0.14.9

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK