DevOpsLesson
DevOpsLesson

Free, comprehensive DevOps tutorials and learning roadmaps. Master Docker, Kubernetes, CI/CD, and more.

Stay Updated

Get notified about new tutorials and features.

Tutorials

  • What is DevOps?
  • Docker Tutorial
  • Terraform Tutorial
  • CI/CD Pipeline
  • All Tutorials

Roadmaps

  • DevOps Engineer
  • Cloud Engineer
  • SRE Path
  • All Roadmaps

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 DevOpsLesson. All rights reserved.

DOCKERKUBERNETESTERRAFORMAWSCI/CDLINUXGITDEVOPS ROADMAPCLOUD ROADMAPSRE ROADMAPGIT CHEATSHEETDOCKER CHEATSHEETK8S CHEATSHEETTF CHEATSHEETLINUX CHEATSHEETDOCKERFILE LINTERYAML VALIDATORCRON PARSERREGEX TESTER

Kubernetes Tutorial

Introduction to Kubernetes
Kubernetes Architecture
Installing Kubernetes
kubectl Basics
Kubernetes Pods
Kubernetes Deployments
Kubernetes Services
ConfigMaps and Secrets
Kubernetes Storage
Kubernetes Namespaces
Kubernetes Resource Management
Helm for Kubernetes
Kubernetes Monitoring

Kubernetes Ingress

PreviousPrev
Next

Route HTTP and HTTPS traffic into your cluster with Ingress rules, controllers, TLS termination, and host or path based routing.

What Is Ingress?

An Ingress is a Kubernetes API resource for HTTP and HTTPS routing. It does not handle traffic by itself. An Ingress Controller such as NGINX or Traefik watches Ingress resources and implements the routing behavior.

Why Use Ingress?

Ingress lets you:

  • route by host name
  • route by URL path
  • terminate TLS centrally
  • share one public entry point across many services

Ingress vs LoadBalancer Service

TopicIngressLoadBalancer Service
Routing levelLayer 7 HTTP/HTTPSLayer 4 network exposure
Multiple appsGreat fitOften one LB per Service
TLS terminationCommon featurePossible but less centralized
Path routingYesNo native path rules

Traffic Diagram

Internet → Ingress Controller → Services → Pods

Internet

app.example.com

HTTP/HTTPS

Ingress Controller

NGINX / Traefik

/api → api-service:80

/web → web-service:80

routes by path/host

Service

api-service

api-pod-1, api-pod-2

Service

web-service

web-pod-1, web-pod-2

Path-Based Routing Example

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: app-ingress
spec:
  rules:
    - host: example.local
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: api-service
                port:
                  number: 80
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web-service
                port:
                  number: 80

Host-Based Routing Example

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: host-ingress
spec:
  rules:
    - host: api.example.local
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: api-service
                port:
                  number: 80
    - host: app.example.local
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web-service
                port:
                  number: 80

TLS Termination Example

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: tls-ingress
spec:
  tls:
    - hosts:
        - app.example.local
      secretName: app-tls
  rules:
    - host: app.example.local
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web-service
                port:
                  number: 80

Why the Controller Matters

Without an Ingress Controller, the Ingress resource is only a rule definition. The controller is the actual traffic manager.

Think of Ingress as the route map and the Ingress Controller as the traffic police who enforce it.

Exercise

Controller Need

Why is an Ingress Controller required?

Exercise

Path Routing

Which Kubernetes resource is best suited for routing `/api` to one service and `/` to another over HTTP?

PreviousPrev
Next

Continue Learning

Kubernetes Service: ClusterIP

Learn the default internal Service type, when to use it, and how DNS and endpoints make in-cluster communication reliable.

18 min·Easy

Kubernetes Service: NodePort

Expose a Service on a fixed port across every node and understand how traffic flows from outside the cluster to pods.

18 min·Easy

Kubernetes Service: LoadBalancer

Learn how LoadBalancer Services provision cloud load balancers, what EXTERNAL-IP means, and when they are a better fit than NodePort.

18 min·Easy

Explore Related Topics

Do

Docker Tutorials

Build the containers Kubernetes orchestrates

Te

Terraform Tutorials

Provision Kubernetes clusters as code

Try the Tool

YAML Validator

Validate Kubernetes manifests and any YAML files instantly.

On This Page

What Is Ingress?Why Use Ingress?Ingress vs LoadBalancer ServiceTraffic DiagramPath-Based Routing ExampleHost-Based Routing ExampleTLS Termination ExampleWhy the Controller Matters