Vagrant can be used to create an isolated environment for Kong and its dependencies.
You can use the Vagrant box either as an all-in-one Kong installation for testing purposes, or you can link it up with source code and start developing on Kong or on custom plugins.
Here is a quick example showing how to build a (disposable) test setup:
-
Get the Vagrantfile and start the VM
$ git clone https://github.com/Kong/kong-vagrant $ cd kong-vagrant/ $ vagrant up
-
Start Kong
The default Vagrantfile will install both PostgreSQL and Cassandra. PostgreSQL is the default:
# specify migrations flag to initialise the datastore $ vagrant ssh -c "kong start --run-migrations"
Cassandra is available via a setting:
$ vagrant ssh -c "KONG_DATABASE=cassandra kong start --run-migrations"
To start Kong in DB-less mode, use this:
$ vagrant ssh -c "KONG_DATABASE=off kong start"
If you want to include a declarative configuration file, put it inside a
./kong/kong.yml
folder, and it will be available through the/kong/kong.yml
path in Vagrant:$ vagrant ssh -c "KONG_DECLARATIVE_CONFIG=/kong/kong.yml KONG_DATABASE=off kong start"
The host ports
8000
,8001
,8443
, and8444
will be forwarded to the Vagrant box.Note: Check out the kong-vagrant repository for further details on customizations and development. -
Use Kong
Kong is running:
$ curl http://127.0.0.1:8001
Quickly learn how to use Kong with the 5-minute Quickstart.
Follow Up:
Get future release notes emailed to you.