Sitemap
Jadhav Swati

Jadhav Swati

🚀 DevOps Engineer | ☁️ AWS Cloud | 📜 Terraform | 🐋 Docker Containers | ♾️ CI/CD | 🐧Linux | 🌐 Computer Networking | Git hub| ✍🏻 Technical Writer

Difference Between Ingress Routing and Ingress Controller in Kubernetes

3 min readJan 18, 2025

--

In Kubernetes, Ingress Routing and Ingress Controller are two closely related but distinct concepts. They work together to manage and route external traffic to services inside the cluster, but they refer to different aspects of how traffic is handled. Let’s break down the differences:

1. Ingress Routing

Ingress Routing refers to the rules and configurations that define how external HTTP or HTTPS traffic should be directed to different services within a Kubernetes cluster. These rules specify how requests are handled based on criteria like:

  • Host-based routing (e.g., api.example.com routes to one service, www.example.com routes to another).
  • Path-based routing (e.g., /api routes to one service, /frontend routes to another).
  • SSL/TLS termination (handling encryption at the Ingress level).
  • Traffic splitting (for A/B testing or canary deployments).

The Ingress resource in Kubernetes defines these routing rules using a YAML or JSON configuration.

Key Points:

  • Ingress routing is about how external requests are routed to services based on the rules you define in an Ingress resource.
  • It can involve host and path matching, SSL termination, traffic splitting, and redirects.
  • Routing rules are defined within the Ingress API resource.

Example of Ingress Routing Rule:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
spec:
rules:
- host: example.com
http:
paths:
- path: /api
pathType: Prefix
backend:
service:
name: api-service
port:
number: 80
- path: /frontend
pathType: Prefix
backend:
service:
name: frontend-service
port:
number: 80
  • This Ingress defines routing rules: traffic going to example.com/api is directed to api-service, while example.com/frontend is routed to frontend-service.

2. Ingress Controller

The Ingress Controller is a component in the Kubernetes cluster that is responsible for implementing the rules defined in the Ingress resource. It is essentially the “reverse proxy” or “load balancer” that processes incoming HTTP/HTTPS requests and routes them to the appropriate Kubernetes services based on the Ingress resource configuration.

Get Jadhav Swati’s stories in your inbox

Join Medium for free to get updates from this writer.

The Ingress controller reads the Ingress resources in the cluster and ensures that the traffic is routed according to the defined rules. Some popular Ingress controllers include NGINX, Traefik, HAProxy, Istio, and Kong.

Key Points:

  • The Ingress controller is a controller or process that implements the routing rules.
  • It runs as a pod within the Kubernetes cluster and manages the external traffic routing.
  • The controller is responsible for handling SSL/TLS termination, path-based routing, host-based routing, and other traffic management tasks.
  • It’s a real-time agent that watches for Ingress resources and configures the proxy or load balancer based on those resources.

Example of Installing an Ingress Controller (NGINX):

To use an Ingress controller like NGINX, you would typically deploy it using a Helm chart or YAML manifest.

Installing NGINX Ingress Controller (via Helm):

helm install nginx-ingress ingress-nginx/ingress-nginx

Once the NGINX Ingress controller is running, it will watch for any Ingress resources defined in the cluster and configure NGINX to route traffic based on the defined Ingress rules.

Key Differences:

Press enter or click to view image in full size

Summary:

  • Ingress Routing: Defines the rules for directing external HTTP/HTTPS traffic to services in the cluster based on hostnames, paths, and other conditions. It’s about how traffic should be managed.
  • Ingress Controller: The component that enforces and processes the Ingress routing rules. It is responsible for actually routing the traffic based on the Ingress resource configuration, acting as a reverse proxy, load balancer, or API gateway.

Both components are essential for managing external traffic and exposing services securely and efficiently within a Kubernetes environment.

--

--

Jadhav Swati
Jadhav Swati