Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the option to API gateway with docker?

I've created several RESTful microservices and dockerized them. Now I want to have a web-based UI for them and the ability to create users and grant permissions to them to use some of the APIs.

I know that I need some kind of API gateway. My first thought was that I always could do that bruteforce way: create some django app that would serve UI and proxy all request to APIs by hand, but this seems very dull. Maybe there are some alternatives? I've ready about Tyk, but can't find any information about the ability to add users and grant permissions to them.

I probably could create an application that would serve as API gateway and automate proxying of requests by writing some code that would model that. So for example I basically need a mapping between external urls to actual api urls and some authorization logic. Maybe there are already something like that?

like image 941
user1685095 Avatar asked Jul 21 '15 18:07

user1685095


People also ask

Is Docker an API gateway?

Docker for the API Gateway It will need some environment to handle requests and responses via server-side code (perhaps Go or Elixir), and it will often be attached to an authentication/authorization service so it can validate requests before proxying them to a micro service.

Does Docker have a REST API?

The Docker Engine API is a RESTful API accessed by an HTTP client such as wget or curl , or the HTTP library which is part of most modern programming languages.

Can you use API gateway with EC2?

You can create an API Gateway API with private integration to provide your customers access to HTTP/HTTPS resources within your Amazon Virtual Private Cloud (Amazon VPC). Such VPC resources are HTTP/HTTPS endpoints on an EC2 instance behind a Network Load Balancer in the VPC.


2 Answers

I was looking for something similar, including support for rate limiting, UI console, etc. It boils down to a few freemium tools like:

  • apigee
  • mashape
  • apiary
  • 3scale.net

and a few open source ones:

  • tyk
  • kong
  • ApiAxle
  • WSO2
  • API Umbrella

I've decided on tyk since it has a nice UI console and solid docs. All of them were mentioned on Quora, which is nice when you want to go shopping :)

like image 155
milan Avatar answered Oct 04 '22 14:10

milan


If you like getting your hands dirty, you could quite easily implement your own simplified API Gateway. I believe this approach perfectly fits into microservice paradigm - implement simple service with limited functionality that does only one thing, but does it well.

I've written a tutorial on this subject (implementing simple API Gateway for Dockerized microservices with Node.js). My example is about 100 lines of JavaScript code, it uses node-docker-monitor to listen to Docker events and http-proxy to handle HTTP requests from the clients.

https://memz.co/api-gateway-microservices-docker-node-js/

or alternative solution with SkyDNS and Nginx

https://memz.co/reverse-proxy-nginx-docker-microservices/

like image 43
Andrey Chausenko Avatar answered Oct 04 '22 13:10

Andrey Chausenko