PGBI / kong-dashboard

Dashboard for managing Kong gateway
MIT License
2.17k stars 390 forks source link

Programmatically set Kong Node URL #77

Closed tylerwiersing closed 6 years ago

tylerwiersing commented 7 years ago

Hello, I am setting up both kong and kong-dashboard through docker and was wondering if there was a way to set the Kong Node URL programmatically instead of having to go through the ui and enter it manually every time. Ideally it would be able to be set through a curl request or something similar.

tylerwiersing commented 7 years ago

So I ended up solving this issue by performing this curl request curl -v GET --url http://localhost:8080/proxy/ --header 'Kong-Node-URL: http://'"$IP_ADDR"':8001' though I suspect there is a better way to do it as this seems really hacky. If there isn't another way then I propose some docs or at least this command be added to the readme for setting up through docker.

PGBI commented 7 years ago

Nope there isn't any other way to do. By the way, nice hack :)

When I get a moment, I'll take a look and see how this could be achieved by setting an environment variable. This would be much cleaner than a curl request.

If you have time to do this, don't hesitate to submit a PR.

tylerwiersing commented 7 years ago

Awesome, thanks for the quick reply! I might be able to get around to a PR this weekend if you don't get to it before then.

machbio commented 7 years ago

@PGBI would it not be possible to load the Kong Admin URL with the same mechanism as providing auth credentials like kong-dashboard start -url http://kong-admin:8001

siwatpru commented 7 years ago

Hey guys, I just submit a PR (https://github.com/PGBI/kong-dashboard/pull/104) fixing this issue. Got it to work on my docker-compose setup now.

luispabon commented 7 years ago

Highly interested in this so that we can fully automate our environment deployments :+1:

PGBI commented 6 years ago

This is now the case with Kong Dashboard v3. No more config UI, all is done at startup: kong-dashboard start --kong-url http://kong:8001

luispabon commented 6 years ago

Perfect, thank you.