Kong is an open source Gateway that provides a layer between an application and its users. It might implement many useful features such as authentication, rate limit and others.
This project implements a simple webpage with flask and an even simpler api that return date and time. All of them managed using kong.
For simplicity, docker compose is being used to orchestrate all of those containers. Nevertheless a k8 may be used just fine.
-
Before doing anything, make sure the custom images are build so it can start with no issues.
kong$ docker-compose build
-
If it is the first time the aplication is being built, a migration is needed on the postgres database. It bootstrap kong on the database. Start by running:
kong$ docker-compose run kong-migrations
-
Start kong by running the kong service, the others services such as apis and database will start right way.
kong$ docker-compose run kong
-
If modifications are done on the kong.yaml, run the syncronization service, deck is used to do that. Be aware to have kong running before run the command bellow.
kong$ docker-compose run deck
This project uses JWT tokens to authorize calls between user and api! Create a valid jwt token on JWT webisite using the iss (key provided on kong.yaml) as payload and the secret (also provided) to verify signature. For more on that please refer to JWT Kong Plugin DOCS.