https://github.com/rnburn/kong-cap
https://github.com/rnburn/kong-cap
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rnburn/kong-cap
- Owner: rnburn
- Created: 2021-03-12T00:33:57.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-18T01:31:41.000Z (about 4 years ago)
- Last Synced: 2025-01-20T02:49:26.147Z (4 months ago)
- Language: Lua
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Install Kong
Follow steps [here](https://docs.konghq.com/enterprise/2.3.x/deployment/installation/docker/).## Set up a service
Adapted from [here](https://docs.konghq.com/getting-started-guide/2.1.x/expose-services/).Define a service
```
curl -i -X POST http://localhost:8001/services \
--data name=example_service \
--data url='http://mockbin.org'
```Verify service
```
curl -i http://localhost:8001/services/example_service
```Add a route
```
curl -i -X POST http://localhost:8001/services/example_service/routes \
--data 'paths[]=/mock' \
--data name=mocking
```Verify the route
```
curl -i -X GET http://localhost:8000/mock/request
```## Set up tracing from Kong
Add Zipkin
```
docker run -d -p 9411:9411 openzipkin/zipkin
```Enable the plugin
```
curl -X POST http://localhost:8001/plugins/ \
--data "name=zipkin" \
--data "config.http_endpoint=http://172.17.0.1:9411/api/v2/spans" \
--data "config.sample_ratio=1.0" \
--data "config.include_credential=true" \
--data "config.traceid_byte_count=16" \
--data "config.header_type=preserve" \
--data "config.default_header_type=b3"
```