[转]容器领域的十大监控系统对比

https://mp.weixin.qq.com/s/IbhUW2Ri-tzAK3bsU8HUtQ

https://mp.weixin.qq.com/s/XR6Vgv9saiDGaAKhQWY_sQ

Advertisements

Use Kong, Limit Rating and Key Authentication


#!/bin/bash

Create a API

curl -i -X POST \
--url http://1.2.3.4:8001/apis/ \
--data 'name=myapp-api' \
--data 'hosts=1.2.3.4' \
--data 'uris=/myapp' \
--data 'upstream_url=http://1.2.3.4:4000'

Add Rate Limiting

curl -i -X POST \
--url http://1.2.3.4:8001/apis/myapp-api/plugins/ \
--data 'name=rate-limiting' \
--data 'config.minute=100'

Add Key Authentication

curl -X POST http://1.2.3.4:8001/apis/myapp-api/plugins \
--data "name=key-auth"

Create a consumer

curl -X POST http://1.2.3.4:8001/consumers \
--data "username=superuser"

Grant API permission to a consumer

curl -X POST http://1.2.3.4:8001/consumers/superuser/key-auth \
--data ""

Get a consumer's key

curl -X GET http://1.2.3.4:8001/consumers/superuser/key-auth

Access API

curl -i -X GET \
--url http://1.2.3.4:8000/myapp \
--header "Host: 1.2.3.4" \
--header "apikey: mykey"