DEV Community 👩‍💻👨‍💻

Setup (Kong + Konga) as API Gateway

Kelvin on April 09, 2020

Welcome! You are about to start on a journey about and how to setup kong as an API Gateway for your infrastructure. In this second chapter, We are ...
Collapse
 
jamallmahmoudi profile image
jamallmahmoudi

Hi cool& perfect

Collapse
 
vousmeevoyez profile image
Kelvin

if this helps please support me so i can produce more quality content to help other developers
Buy Me A Coffee

Collapse
 
ayyappa99 profile image
Ayyappa

@vousmeevoyez : Unfortunately, running the same exact script giving below error
'FATAL: database "konguser" does not exist'

Collapse
 
vousmeevoyez profile image
Kelvin

Hi could you share more details? do you run it using start.sh? or just docker-compose?

Collapse
 
giesberge profile image
giesberge

I've tried from both and I have the same error,

Thread Thread
 
vousmeevoyez profile image
Kelvin

hi could you share your error?

Thread Thread
 
giesberge profile image
giesberge

database "konguser" does not exist. This is also after running a docker system prune:
pastebin.com/yJkp7BYK

Thread Thread
 
vousmeevoyez profile image
Kelvin

Hi giesberge can you try with this following sequence

  • docker system prune --volumes
  • mv .env.sample .env
  • update .env from
KONGA_ENV=production
Enter fullscreen mode Exit fullscreen mode

to

KONGA_ENV=development
Enter fullscreen mode Exit fullscreen mode
  • ./start.sh
  • go to localhost:9000

if this helps please support me so i can produce more quality content to help other developers
Buy Me A Coffee

Thread Thread
 
giesberge profile image
giesberge

Already done, I even tried changing the db_names but that didn't work. pastebin.com/wmcHb9Tw

Thread Thread
 
vousmeevoyez profile image
Kelvin

I've notice you're using windows. Did you use wsl? And what terminal are you running? Command prompt?

Collapse
 
ayyappa99 profile image
Ayyappa

I ran with start.sh script
Also what i noticed was the db name needs to be kong always else kong is throwing kong database doesn't exist.

Thread Thread
 
vousmeevoyez profile image
Kelvin

yes, I forgot to mention that in article. thanks man

Collapse
 
tiagosmx profile image
Tiago Stapenhorst Martins

Brilliant post dude! Your guide is valuable and well written.
I have been trying with no success to setup Kong and Konga with docker a while ago by following their git and official pages. Their documentation aren't very friendly indeed.
Thanks!

Collapse
 
tikam02 profile image
Tikam Singh Alma

I ran with start.sh script
db_1 | FATAL: database "konguser" does not exist

Collapse
 
vousmeevoyez profile image
Kelvin

Hi Tikam, sorry for slow response. Been very busy this couple months. try stop and clearing all volumes

docker-compose down
docker system prune --volumes
Enter fullscreen mode Exit fullscreen mode

also use this setting as .env

# KONG SETTING
KONG_DB_NAME=db_kong
KONG_DB_USERNAME=konguser
KONG_DB_PASSWORD=kongpassword
KONG_DB_HOST=db
KONG_DB_PORT=5432

KONG_DATABASE=postgres
KONG_PROXY_ACCESS_LOG=/dev/stdout
KONG_ADMIN_ACCESS_LOG=/dev/stdout
KONG_PROXY_ERROR_LOG=/dev/stderr
KONG_ADMIN_ERROR_LOG=/dev/stderr
KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl

KONG_PROXY_PORT=8000
KONG_PROXY_SSL_PORT=8443

# KONGA SETTING
KONGA_DB_NAME=db_konga
KONGA_DB_USERNAME=kongauser
KONGA_DB_PASSWORD=kongapassword
KONGA_DB_HOST=db
KONGA_DB_PORT=5432

KONGA_TOKEN_SECRET=some-secret-token
KONGA_ENV=production
KONGA_PORT=9000
Enter fullscreen mode Exit fullscreen mode
Collapse
 
tikam02 profile image
Tikam Singh Alma

Thank you so much @kelvin for the help.

Collapse
 
amirhs712 profile image
amirhs712

where do I get docker-entrypoint.sh?

Collapse
 
vousmeevoyez profile image
Kelvin

Hi amirhs, terribly sorry for slow response. You can find the docker-entrypoint for the postgres container here github.com/vousmeevoyez/kong-konga...