Skip to content

Instantly share code, notes, and snippets.

@wildone
Last active June 13, 2020 14:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
setup kong api gateway and gui

Info

Some of these instructions were not working in source so here are the updates:

create db

docker run -d --name kong-database \
                -p 5432:5432 \
               -e "POSTGRES_USER=kong" \
               -e "POSTGRES_DB=kong" \
               -e "POSTGRES_PASSWORD=kong" \
                 postgres:9.6

setup db

docker run --rm \
    --link kong-database:kong-database \
     -e "KONG_DATABASE=postgres" \
     -e "KONG_PG_HOST=kong-database" \
     -e "KONG_PG_USER=kong" \
     -e "KONG_PG_PASSWORD=kong" \
     -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
    kong kong migrations bootstrap

run kong


docker run -d --name kong \
    --link kong-database:kong-database \
    -e "KONG_DATABASE=postgres" \
    -e "KONG_PG_HOST=kong-database" \
    -e "KONG_PG_USER=kong" \
    -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 8000:8000 \
    -p 8443:8443 \
    -p 8001:8001 \
    -p 8444:8444 \
    kong

run postgre ui

docker run -d -p 9001:80 \
    --name postgre-ui \
    --link kong-database:kong-database \
    -e 'PGADMIN_DEFAULT_EMAIL=max.barrass@gmail.com' \
    -e 'PGADMIN_DEFAULT_PASSWORD=admin' \
    -d dpage/pgadmin4

run prep konga ui db

docker run --rm --link kong-database:kong-database \
pantsel/konga:latest -c prepare -a postgres -u postgresql://kong:kong@kong-database:5432/konga

run konga ui


docker run -d -p 9000:1337 \
  --name konga \
  --link kong-database:kong-database \
  -e "TOKEN_SECRET=aaa" \
  -e "DB_ADAPTER=postgres" \
  -e "DB_HOST=kong-database" \
  -e "DB_PORT=5432" \
  -e "DB_USER=kong" \
  -e "DB_PASSWORD=kong" \
  -e "DB_DATABASE=konga" \
  -e "NODE_ENV=production" \
  pantsel/konga

Ports of Interest

  • 8000 - Kong API Route
  • 8001 - Kong admin port its what you need to setup as a connection in Konga
  • 9000 - Konga UI
  • 9001 - Postgre UI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment