This Repository allows to deploy Kong Api Gateway and Konga Kong admin GUI as docker containers by using the provided docker-compose files.
Also, it provides a Dockerfile for building a custom Kong image which includes the custom plugins request-throttling and header-checker which can be deployed using the same docker-compose files.
docker-compose -f docker-compose-kong-v0.14 up
docker-compose -f docker-compose-kong-v1.3.yml up
If you want to deploy the docker image that can be created with the Dockerfile, which includes the custom plugins, just change in the docker-compose-kong-v1.3.yml the kong image name "kong:1.3.0-ubuntu" to "{custom_kong_image_name:custom_kong_image_tag}".
docker run -p 80:80 kennethreitz/httpbin
docker inspect {container_id}If you install the request-throttling plugin to kong, you can connect to the redis server to see the token which are being generated.
docker run -it --network kong-setup_kong-net --rm redis redis-cli -h kong-setup_redis_1
curl -i -X POST
--url http://localhost:8001/services/
--data 'name=httpbin-service-get'
--data 'url=http://eu.httpbin.org/get'
curl -i -X POST
--url http://localhost:8001/services/httpbin-service-get/routes
--data 'hosts[]=examplehttpbin.com'
curl -i -X GET
--url http://localhost:8000/
--header 'Host: examplehttpbin.com'
curl -i -X POST
--url http://localhost:8001/services/httpbin-service-get/plugins/
--data 'name=key-auth'
curl -i -X POST
--url http://localhost:8001/services/httpbin-service-get/plugins/
--data 'name=key-auth'
--data 'config.key_names=apikey, credentialtest'
curl -i -X POST
--url http://localhost:8001/consumers/
--data "username=Jason"
curl -i -X POST
--url http://localhost:8001/consumers/Jason/key-auth/
--data 'key=key1'
curl -i -X GET
--url http://localhost:8000
--header "Host: examplehttpbin.com"
--header "apikey: key1"
curl -i -X GET
--url http://localhost:8000
--header "Host: examplehttpbin.com"
--header "apikey: key1"
--header "user-agent:secretAgent"
curl -i -X POST
--url http://localhost:8001/services/httpbin-service-get/plugins/
--data 'name=helloworld'
curl -i -X POST
--url http://localhost:8001/services/httpbin-service-get/plugins/
--data 'name=headerchecker'
curl -i -X POST
--url http://localhost:8001/services/httpbin-service-get/plugins/
--data 'name=headerchecker'
--data 'config.allowed_users=additionalSecretAgent'
curl -i -X POST
--url http://localhost:8001/services/httpbin-service-get/routes
--data 'paths[]=/httpbin/get'
curl -i -X GET
--url http://localhost:8000
--header "Host: examplehttpbin.com"
--header "apikey: key1"
curl -i -X POST
--url http://localhost:8001/routes/`{route_id}`/plugins/
--data 'name=headerchecker'
curl -i -X POST
--url http://localhost:8001/consumers/`{consumer_id}`/plugins
--data 'name=headerchecker'
--data 'route_id={route_id}'
--data 'config.allowed_header_values=secretAgent'
curl -i -X GET
--url http://localhost:8000/httpbin/post
--header "apikey: key1"
--header "user-agent: secretAgent"
curl -i -X POST
--url http://localhost:8001/consumers/`{consumer_id}`/plugins
--data 'name=headerchecker'
--data 'route_id={route_id}'
--data 'config.header_to_check=user-agent'
--data 'config.allowed_header_values=secretAgent1, secretAgent2'
Content type
Image
Digest
Size
128.5 MB
Last updated
about 5 years ago
docker pull jaganthoutam/kong