π Exposing Applications Using Ingress (Beginner Friendly)
Open to Work | Cloud & DevOps Engineer | AWS | Kubernetes | Terraform | CI/CD | Automations | Available for Full-Time / Freelance / Mentorship
So far, our application is running inside the Kubernetes cluster and is accessible only internally using a Service (ClusterIP).
But as a fresher, the big question is:
β How do users access my application from a browser?
Thatβs where Ingress comes in.
π€ What Is Ingress in Kubernetes?
Ingress is a Kubernetes resource that:
Exposes HTTP/HTTPS routes
Acts as a smart entry point to your cluster
Routes traffic to services based on URL paths or domains
Think of Ingress as:
π§ A traffic controller sitting in front of your services
π Service vs Ingress (Simple Comparison)
| Feature | Service | Ingress |
| Internal access | β | β |
| External access | β | β |
| Path-based routing | β | β |
| TLS / HTTPS | β | β |
| Load balancing | Basic | Advanced |
ποΈ How Ingress Works (Beginner Flow)
Browser
β
Ingress Controller (NGINX / ALB)
β
Ingress Rules
β
Service
β
Pod
π Important Note:
Ingress does not work alone.
You must install an Ingress Controller (like NGINX or AWS ALB).
π§© Ingress Controller (One-Time Setup)
For learning & labs, most beginners use NGINX Ingress Controller.
Example (one-time install):
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml
β οΈ This is similar to how Argo CD provides an install.yaml.
π Ingress YAML (Add to Same Single File)
Add this at the bottom of your myapp-install.yaml:
---
# =========================
# 11. Ingress
# =========================
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: myapp-ingress
namespace: myapp
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx
rules:
- host: myapp.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: myapp-service
port:
number: 80
π Ingress YAML Explained (Fresher View)
πΉ ingressClassName
ingressClassName: nginx
π Tells Kubernetes which ingress controller to use.
πΉ Host
host: myapp.example.com
π Domain name used to access the application.
For local testing:
sudo nano /etc/hosts
<Ingress-IP> myapp.example.com
πΉ Path Routing
path: /
pathType: Prefix
π Routes all traffic starting with / to the service.
πΉ Backend Service
service:
name: myapp-service
port:
number: 80
π Ingress never talks to Pods directly
It always routes traffic via a Service.
π HTTPS & TLS (Beginner Awareness)
Ingress can also:
Enable HTTPS
Use TLS certificates
Integrate with cert-manager
(This is usually asked in interviews π)
π Accessing the Application
After applying:
kubectl apply -f myapp-install.yaml
Check ingress:
kubectl get ingress -n myapp
Open in browser:
http://myapp.example.com
π§ Interview Tip (Very Important)
Ingress vs LoadBalancer Service
β Service (LoadBalancer) β Exposes one service
β Ingress β Exposes multiple services using one IP
π― Why Freshers Should Learn Ingress Early
Used in real production
Mandatory for microservices
Required for Argo CD, EKS, AKS, GKE
Common interview topic
π Final Takeaway
If you now understand:
Service
Ingress
Ingress Controller
π You are already ahead of many beginners in Kubernetes.
π¬ Question for You
Do you want a real EKS Ingress setup using AWS ALB or NGINX Ingress deep dive next?