Ingress
LoadBalancer gives each Service its own external IP. But what if you have many services? That’s expensive and wasteful. Ingress solves this by providing a single entry point that routes HTTP/HTTPS traffic to different Services based on rules.
What Is Ingress?
Ingress is not a Service type. It’s an API object that manages external access to Services, typically HTTP. It can provide load balancing, SSL termination, and name‑based virtual hosting.
Ingress exposes HTTP and HTTPS routes from outside the cluster to Services.
Ingress Controller
To use Ingress, you need an Ingress Controller running in your cluster (e.g., NGINX Ingress Controller, Traefik, AWS ALB Ingress Controller). Minikube has a built‑in addon for NGINX Ingress.
Enable it on Minikube:
minikube addons enable ingressIngress YAML Example
Assume you have two Services:
service-a and service-b. You want to route /app1 to service-a and /app2 to service-b:apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
spec:
rules:
- http:
paths:
- path: /app1
pathType: Prefix
backend:
service:
name: service-a
port:
number: 80
- path: /app2
pathType: Prefix
backend:
service:
name: service-b
port:
number: 80Apply the Ingress:kubectl apply -f ingress.yamlTesting Ingress
On Minikube, get the IP address of the Ingress controller:
kubectl get ingressThen access http://<ingress-ip>/app1 and http://<ingress-ip>/app2.SSL/TLS with Ingress
You can attach a TLS certificate to an Ingress. You’ll need a Kubernetes Secret containing the cert and key, then reference it in the Ingress spec under
tls.Two Minute Drill
- Ingress exposes multiple HTTP/HTTPS services through a single external IP.
- Requires an Ingress Controller (e.g., NGINX Ingress).
- Define routing rules based on hostnames or paths.
- Supports SSL termination and name‑based virtual hosting.
Need more clarification?
Drop us an email at career@quipoinfotech.com
