What if you could control all your app traffic with just one simple rule set?
Why Ingress resource definition in Kubernetes? - Purpose & Use Cases
Imagine you have many websites or services running on different servers, and you want to let users access them all through one single address.
Without a smart way to manage this, you would have to tell users exactly which server and port to use for each service.
Manually configuring each service's address and port is confusing and error-prone.
Users might get lost or connect to the wrong service.
Also, updating these settings every time you add or change a service takes a lot of time and can cause downtime.
An Ingress resource in Kubernetes acts like a smart traffic controller.
It lets you define rules to route user requests to the right service based on the URL or host name.
This way, you only need one entry point, and Kubernetes handles the rest automatically.
kubectl expose pod myapp --port=8080 kubectl expose pod myapi --port=9090 Users must use IP:8080 or IP:9090
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
spec:
rules:
- host: myapp.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: myapp
port:
number: 80
It enables simple, centralized access to multiple services through friendly URLs, improving user experience and operational efficiency.
A company runs a website, a blog, and an API service on Kubernetes.
Using Ingress, they let users visit www.company.com for the website, blog.company.com for the blog, and api.company.com for the API, all through one IP address.
Manual service access is confusing and hard to maintain.
Ingress defines rules to route traffic smartly inside Kubernetes.
This simplifies access and scales easily as services grow.