32

I would like to know what is/are differences between an api gateway and Ingress controller. People tend to use these terms interchangeably due to similar functionality they offer. When I say, 'Ingress controller'; don't confuse it with Ingress objects provided by kubernetes. Also, it would be nice if you can explain the scenario where one will be more useful than other.

Is api gateway a generic term used for traffic routers in cloud-native world and 'Ingress controller' is implementation of api-gateway in kubernetes world?

Prateek Jain
  • 2,738
  • 4
  • 28
  • 42

3 Answers3

33

Ingress controller allows single ip-port to access all services running in k8s through ingress rules. The ingress controller service is set to load balancer so it is accessible from public internet.

An api gateway is used for application routing, rate limiting, security, request and response handling and other application related tasks. Say, you have a microservice based application in which the request needs an information to be collected from multiple micro services. You need a way to distribute the user requests to different services and gather the responses from all micro services and prepare the final response to be sent to the user. API Gateway is the one which does this kind of work for you.

P Ekambaram
  • 15,499
  • 7
  • 34
  • 59
  • 1
    +1. But you posted this in 2019, is it still relevant or some part of this is outdated? Would you mind adding more information (if applicable) to make a detailed answer of this very popular question about API Gateway v/s Ingress. – hagrawal7777 Mar 28 '21 at 06:56
  • Is an API gateway needed if we have a front-ending microservice taking care of API aggregation. e.g., BFF Microservice exposing GraphQL interface? – TechEnthusiast Sep 03 '21 at 14:36
  • Does this mean that the Ingress Controller should have only one routing rule and that is the one to the API Gateway. While the API Gateway handles the routing to the specific services? – Joko Feb 13 '22 at 10:27
  • an ingress controller can support multiple ingress rules. say, you want to access grafana/kibana/prometheus/alert manager/application web interfaces from a browser then you can define one ingress rule for each of those services and the ingress controller would route the user request to the appropriate backend service – P Ekambaram Feb 14 '22 at 04:03
9

Ingress

Ingress manages and route the traffic into Kubernetes services.

Ingress rules/config yaml and backed by Ingress controller (Nginx ingress controller famous one)

Ingress controller makes one Kubernetes service using that get exposed as LoadBalancer.

enter image description here

Other list of ingrss controller : https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/

For simple understanding, you can consider ingress as Nginx server which just do the work of forwarding the traffic to services based on the ruleset.

ingress don't have much functionality like API gateway. Some of ingress don't support authentication, rate limiting, application routing, security, merging response & request, and other add-ons/plugin options.

API gateway

API gateway can also do the work of simple routing but it's mostly gets used when you need higher flexibility, security and configuration options.

There are lots of parameters to compare when you are choosing the Ingress or API gateway however it's more depends on your usecase.

API gateway like KrakenD, Kong are way better compare to ingress have security integration like Oauth plugin, API key option, it support rate-limiting, API aggregation.

Kong API gateway also has a good plugin option which you can use if you want to configure logging/monitoring of traffic also.

There are so many API gateways available in the market same as the ingress controller, you can check the API gateway feature and comparison below.

enter image description here

Read more at : https://medium.com/@harsh.manvar111/api-gateway-identity-server-comparison-ec439468cc8a

If your use case is small and sure about requirement you can use the ingress also for production API gateway is not necessary.

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
4

Indeed both have a set of features that intersect, path mapping, path conversion, load balancing, etc.

However, they do differ. I may be wrong, but you create an Ingress 1) to run it in Kubernetes 2) to be more of like a reverse proxy "kubernetes native".

API Gateway could be installed anywhere (although there are now many that run in Kubernetes natively like Ambassador, Gloo, Kong), and they do have more functionality available like developer portal, rate limiting, etc.

Personally I use an ingress as a reverse proxy for a website. And API Gateway for APIs. This does not mean you can't use ingress for apis. However, you are not taking full advantage of them.

Kat Lim Ruiz
  • 2,425
  • 2
  • 26
  • 32