Handling traffic with Nginx Ingress Controller In EKS based cluster and EC2 based clusters .

jaffar shaik
2 min readNov 28, 2023
  1. Nginx ingress controllers are used to route incoming cluster traffic HTTP requests to the appropriate service, which then pass the request to one of its pods.
Figure Ingress controller .

A minimal ingress controller :

2. The ingress controllers run as pods within each Kubernetes cluster. Their location depends on whether it is running in an eks based cluster or Ec2 based cluster .

Figure EC2 based and EKS based clusters.

Nginx configuration file:

1.The ingress controller is configured via its own /etc/nginx/nginx.conf file.

2. It contains instructions on how incoming URLs should be
forwarded onto other services (pods), based on the URL path.

3. As application pods start up within the cluster, this file is updated dynamically with details of the new pod’s name and the URL path(s)
that the pod supports.

4.The example below tells the ingress controller that if it receives a web request where the URL path begins with /api/authn then it
should forward the request to the app-authentication service in the namespace a-a-a .

5.This service will then forward the request to
one of its associated pods.

Figure Url management by Nginx.

To see a service where is Routed can be analyzed as below :

Figure : service routing Examples.

.

--

--