SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
Thibault Charbonnier
Kong Lead Engineer @ Mashape
1
Manage your APIs and
Microservices with an API
Gateway
03/30/2017 - Swagger & Kong meetup @ Mashape HQ
2
Summary
1. Why an API Gateway?
2. Kong
3. Demo
4. Kong 0.10
03/30/2017 - Swagger & Kong meetup @ Mashape HQ
Why an API Gateway?
3
Why an API Gateway?
Building vs Running an API
4
Why an API Gateway?
It’s a reverse proxy, sitting between your clients and your upstream services
5
Why an API Gateway?
6
Monolithic vs Microservices
7
https://github.com/Mashape/kong https://getkong.org/plugins/
Kong Overview
8
9
Kong Overview - Stack
NGINX
lua-nginx-module
Kong
C
Lua
(but really, LuaJIT)
OpenResty(Lua libraries)
Kong PluginsCommunity Plugins
ngx_http_proxy_module
Kong Overview - Datacenter architecture
10
PostgreSQL
K
Microservice A
K
K
Microservice B
Microservice C
Internal API
LBClient
Kong Overview - Multi-datacenter architecture
11
us-west-1 us-east-1
Cassandra Cassandra
K K K K K K
Microservice
A
Microservice
B
Microservice
C
Microservice
A
Microservice
B
Microservice
C
LB LB
Demo
12
13
$ kong version
0.10.1
$ kong start
Demo
1. Start Kong
2. Add an API
3. Apply a plugin on it
4. Make an API call
14
$ curl -i -X POST http://localhost:8001/apis/ 
-d "name=example" 
-d "upstream_url=http://httpbin.org" 
-d "hosts=example.org"
Demo
Step 1: add an API
Here, we are calling the Admin API Server (port 8001)
15
$ curl -i -X POST http://localhost:8001/apis/example/plugins/ 
-d "name=request-transformer" 
-d "config.add.headers=x-new-header:foo"
Demo
Step 2: apply a plugin
Here, we are calling the Admin API Server (port 8001)
16
$ curl -i http://localhost:8000/get 
-H "Host: example.org"
Demo
Step 3: make an API call
Notice how this request is going through the Proxy Server (port 8000)
Kong 0.10
- Dynamic load balancing
- Coupled with DNS resolution (A & SRV records)
- Flexible routing
- AWS Lambda plugin
- Performance improvements
https://github.com/Mashape/kong/releases/tag/0.10.0
17
Demo - 0.10
18
19
$ curl -i -X POST http://localhost:8001/upstreams/ 
-d "name=httpbin.org"
Demo 0.10
Step 1: add an Upstream Object
20
$ curl -i -X POST 
--url http://localhost:8001/upstreams/httpbin.org/targets 
-d "target=<ip>:<port>" 
-d "weight=100" 
Demo 0.10
Step 2: add Targets to the Upstream
21
$ curl -i http://localhost:8000/get 
-H "Host: example.org"
Demo 0.10
Step 3: make an API call with load balancing
Thank you!
22
Questions?
https://getkong.org
https://www.mashape.com
https://github.com/Mashape/kong
03/30/2017 - Swagger & Kong meetup @ Mashape HQ

Contenu connexe

Tendances

Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservices
Kunal Hire
 

Tendances (20)

API Gateway: Nginx way
API Gateway: Nginx wayAPI Gateway: Nginx way
API Gateway: Nginx way
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway
 
APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strat...
APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strat...APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strat...
APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strat...
 
Mastering Microservices with Kong (DevoxxUK 2019)
Mastering Microservices with Kong (DevoxxUK 2019)Mastering Microservices with Kong (DevoxxUK 2019)
Mastering Microservices with Kong (DevoxxUK 2019)
 
Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservices
 
Flexible, hybrid API-led software architectures with Kong
Flexible, hybrid API-led software architectures with KongFlexible, hybrid API-led software architectures with Kong
Flexible, hybrid API-led software architectures with Kong
 
Gatekeeper: API gateway
Gatekeeper: API gatewayGatekeeper: API gateway
Gatekeeper: API gateway
 
Using an API Gateway for Microservices
Using an API Gateway for MicroservicesUsing an API Gateway for Microservices
Using an API Gateway for Microservices
 
Ambassador Kubernetes-Native API Gateway
Ambassador Kubernetes-Native API GatewayAmbassador Kubernetes-Native API Gateway
Ambassador Kubernetes-Native API Gateway
 
Kubernetes + netflix oss
Kubernetes + netflix ossKubernetes + netflix oss
Kubernetes + netflix oss
 
Deploying Kong with Mesosphere DC/OS
Deploying Kong with Mesosphere DC/OSDeploying Kong with Mesosphere DC/OS
Deploying Kong with Mesosphere DC/OS
 
Practical tips and tricks for Apache Kafka messages integration | Francesco T...
Practical tips and tricks for Apache Kafka messages integration | Francesco T...Practical tips and tricks for Apache Kafka messages integration | Francesco T...
Practical tips and tricks for Apache Kafka messages integration | Francesco T...
 
Exposing and Controlling Kafka Event Streaming with Kong Konnect Enterprise |...
Exposing and Controlling Kafka Event Streaming with Kong Konnect Enterprise |...Exposing and Controlling Kafka Event Streaming with Kong Konnect Enterprise |...
Exposing and Controlling Kafka Event Streaming with Kong Konnect Enterprise |...
 
Spring Cloud and Netflix OSS overview v1
Spring Cloud and Netflix OSS overview v1Spring Cloud and Netflix OSS overview v1
Spring Cloud and Netflix OSS overview v1
 
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
 
Microservices & API Gateways
Microservices & API Gateways Microservices & API Gateways
Microservices & API Gateways
 
Cloudsolutionday 2016: Docker & FAAS at getvero.com
Cloudsolutionday 2016: Docker & FAAS at getvero.comCloudsolutionday 2016: Docker & FAAS at getvero.com
Cloudsolutionday 2016: Docker & FAAS at getvero.com
 
Microservice: starting point
Microservice:  starting pointMicroservice:  starting point
Microservice: starting point
 
Kubernetes: The evolution of distributed systems | DevNation Tech Talk
Kubernetes: The evolution of distributed systems | DevNation Tech TalkKubernetes: The evolution of distributed systems | DevNation Tech Talk
Kubernetes: The evolution of distributed systems | DevNation Tech Talk
 
WTF Do We Need a Service Mesh?
WTF Do We Need a Service Mesh? WTF Do We Need a Service Mesh?
WTF Do We Need a Service Mesh?
 

Similaire à Manage your APIs and Microservices with an API Gateway

Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
 

Similaire à Manage your APIs and Microservices with an API Gateway (20)

Introduction to CloudStack API
Introduction to CloudStack APIIntroduction to CloudStack API
Introduction to CloudStack API
 
Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
 
Where is my scalable API?
Where is my scalable API?Where is my scalable API?
Where is my scalable API?
 
Where is my scalable api?
Where is my scalable api?Where is my scalable api?
Where is my scalable api?
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
 
New and smart way to develop microservice for istio with micro profile
New and smart way to develop microservice for istio with micro profileNew and smart way to develop microservice for istio with micro profile
New and smart way to develop microservice for istio with micro profile
 
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API Gateway
 
Mасштабирование микросервисов на Go, Matt Heath (Hailo)
Mасштабирование микросервисов на Go, Matt Heath (Hailo)Mасштабирование микросервисов на Go, Matt Heath (Hailo)
Mасштабирование микросервисов на Go, Matt Heath (Hailo)
 
Sprint 17
Sprint 17Sprint 17
Sprint 17
 
Using the Event Gateway To Build Multi-Cloud Serverless Applications - JeffCo...
Using the Event Gateway To Build Multi-Cloud Serverless Applications - JeffCo...Using the Event Gateway To Build Multi-Cloud Serverless Applications - JeffCo...
Using the Event Gateway To Build Multi-Cloud Serverless Applications - JeffCo...
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-ServicesNode Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
 
Building Serverless APIs on AWS
Building Serverless APIs on AWSBuilding Serverless APIs on AWS
Building Serverless APIs on AWS
 
Evolution of kube-proxy (Brussels, Fosdem 2020)
Evolution of kube-proxy (Brussels, Fosdem 2020)Evolution of kube-proxy (Brussels, Fosdem 2020)
Evolution of kube-proxy (Brussels, Fosdem 2020)
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
The 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWAREThe 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWARE
 
The Serverless Paradigm, OpenWhisk and FIWARE
The Serverless Paradigm, OpenWhisk and FIWAREThe Serverless Paradigm, OpenWhisk and FIWARE
The Serverless Paradigm, OpenWhisk and FIWARE
 
2018 10-31 modern-http_routing-lisa18
2018 10-31 modern-http_routing-lisa182018 10-31 modern-http_routing-lisa18
2018 10-31 modern-http_routing-lisa18
 

Plus de Thibault Charbonnier

Plus de Thibault Charbonnier (6)

Kong in 1.x Territory
Kong in 1.x TerritoryKong in 1.x Territory
Kong in 1.x Territory
 
Layered caching in OpenResty (OpenResty Con 2018)
Layered caching in OpenResty (OpenResty Con 2018)Layered caching in OpenResty (OpenResty Con 2018)
Layered caching in OpenResty (OpenResty Con 2018)
 
Layered Caching in OpenResty
Layered Caching in OpenRestyLayered Caching in OpenResty
Layered Caching in OpenResty
 
A Kong retrospective: from 0.10 to 0.13
A Kong retrospective: from 0.10 to 0.13A Kong retrospective: from 0.10 to 0.13
A Kong retrospective: from 0.10 to 0.13
 
Developing a user-friendly OpenResty application
Developing a user-friendly OpenResty applicationDeveloping a user-friendly OpenResty application
Developing a user-friendly OpenResty application
 
A Cassandra driver from and for the Lua community
A Cassandra driver from and for the Lua communityA Cassandra driver from and for the Lua community
A Cassandra driver from and for the Lua community
 

Dernier

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

Manage your APIs and Microservices with an API Gateway

  • 1. Thibault Charbonnier Kong Lead Engineer @ Mashape 1 Manage your APIs and Microservices with an API Gateway 03/30/2017 - Swagger & Kong meetup @ Mashape HQ
  • 2. 2 Summary 1. Why an API Gateway? 2. Kong 3. Demo 4. Kong 0.10 03/30/2017 - Swagger & Kong meetup @ Mashape HQ
  • 3. Why an API Gateway? 3
  • 4. Why an API Gateway? Building vs Running an API 4
  • 5. Why an API Gateway? It’s a reverse proxy, sitting between your clients and your upstream services 5
  • 6. Why an API Gateway? 6 Monolithic vs Microservices
  • 9. 9 Kong Overview - Stack NGINX lua-nginx-module Kong C Lua (but really, LuaJIT) OpenResty(Lua libraries) Kong PluginsCommunity Plugins ngx_http_proxy_module
  • 10. Kong Overview - Datacenter architecture 10 PostgreSQL K Microservice A K K Microservice B Microservice C Internal API LBClient
  • 11. Kong Overview - Multi-datacenter architecture 11 us-west-1 us-east-1 Cassandra Cassandra K K K K K K Microservice A Microservice B Microservice C Microservice A Microservice B Microservice C LB LB
  • 13. 13 $ kong version 0.10.1 $ kong start Demo 1. Start Kong 2. Add an API 3. Apply a plugin on it 4. Make an API call
  • 14. 14 $ curl -i -X POST http://localhost:8001/apis/ -d "name=example" -d "upstream_url=http://httpbin.org" -d "hosts=example.org" Demo Step 1: add an API Here, we are calling the Admin API Server (port 8001)
  • 15. 15 $ curl -i -X POST http://localhost:8001/apis/example/plugins/ -d "name=request-transformer" -d "config.add.headers=x-new-header:foo" Demo Step 2: apply a plugin Here, we are calling the Admin API Server (port 8001)
  • 16. 16 $ curl -i http://localhost:8000/get -H "Host: example.org" Demo Step 3: make an API call Notice how this request is going through the Proxy Server (port 8000)
  • 17. Kong 0.10 - Dynamic load balancing - Coupled with DNS resolution (A & SRV records) - Flexible routing - AWS Lambda plugin - Performance improvements https://github.com/Mashape/kong/releases/tag/0.10.0 17
  • 19. 19 $ curl -i -X POST http://localhost:8001/upstreams/ -d "name=httpbin.org" Demo 0.10 Step 1: add an Upstream Object
  • 20. 20 $ curl -i -X POST --url http://localhost:8001/upstreams/httpbin.org/targets -d "target=<ip>:<port>" -d "weight=100" Demo 0.10 Step 2: add Targets to the Upstream
  • 21. 21 $ curl -i http://localhost:8000/get -H "Host: example.org" Demo 0.10 Step 3: make an API call with load balancing