【学习】-【kong】搭建kong服务

前置环境:

  • docker

拉取镜像

  • docker pull postgres:9.4
  • docker pull kong:0.13.1-centos

run镜像

  • 构建通信网络
docker network create kong-net
  • 安装数据库
docker run --rm \
    --network=kong-net \
    -e "KONG_DATABASE=postgres" \
    -e "KONG_PG_HOST=kong-database" \
    -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
    kong:0.13.1-centos kong migrations up
  • 初始化数据库
docker run --rm \
    --network=kong-net \
    -e "KONG_DATABASE=postgres" \
    -e "KONG_PG_HOST=kong-database" \
    -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
    kong:0.13.1-centos kong migrations up
  • 运行kong
docker run -d --name kong \
    --network=kong-net \
    -e "KONG_DATABASE=postgres" \
    -e "KONG_PG_HOST=kong-database" \
    -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 8000:8000 \
    -p 8443:8443 \
    -p 8001:8001 \
    -p 8444:8444 \
    kong:0.13.1-centos
  • 安装kong-dashboad
  • docker run -d --name kong-dashboard -p 30092:8080 pgbi/kong-dashboard:v3.3.0 start --kong-url http://www.byrdmacip.com:8001 --basic-auth kxp=123456
  • 后续更新中
发布了11 篇原创文章 · 获赞 6 · 访问量 9570

猜你喜欢

转载自blog.csdn.net/u014174048/article/details/82422873
今日推荐