Skip to main content

Command Palette

Search for a command to run...

🌐 Exposing Applications Using Ingress (Beginner Friendly)

Published
β€’3 min readβ€’View as Markdown
N

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)

FeatureServiceIngress
Internal accessβœ…βŒ
External accessβŒβœ…
Path-based routingβŒβœ…
TLS / HTTPSβŒβœ…
Load balancingBasicAdvanced

πŸ—οΈ 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?

More from this blog

Beginner to Advanced

16 posts