Inferensys

Glossary

Ingress

Ingress is a Kubernetes API object that defines rules for managing external HTTP and HTTPS access to services running within a cluster.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
KUBERNETES NETWORKING

What is Ingress?

In Kubernetes, an Ingress is an API object that manages external HTTP and HTTPS access to services running inside a cluster.

An Ingress is a Kubernetes API object that defines rules for routing external HTTP/HTTPS traffic to internal Services. It acts as a smart layer-7 (application layer) load balancer and traffic router, typically handling tasks like SSL/TLS termination, host-based routing, and path-based routing. Unlike a Service of type LoadBalancer, which operates at layer 4 (TCP/UDP), an Ingress provides more granular control over web traffic. It requires an Ingress Controller, a pod that implements the rules defined in the Ingress resource.

The Ingress Controller is the active component that fulfills the Ingress rules. Popular implementations include the NGINX Ingress Controller, Traefik, and cloud-provider managed controllers like AWS Application Load Balancer (ALB). An Ingress manifest specifies a set of rules; each rule matches incoming traffic based on a host (e.g., api.example.com) and a path (e.g., /v1/users), and directs it to a specific backend Service and port. This enables a single external IP address to serve multiple services, a pattern known as name-based virtual hosting.

KUBERNETES NETWORKING

Key Features of Ingress

A Kubernetes Ingress is an API object that manages external access to services within a cluster, primarily for HTTP/HTTPS traffic. It acts as a smart traffic router, providing a single point of entry with advanced routing rules.

01

HTTP/HTTPS Routing

The core function of an Ingress is to route external HTTP and HTTPS requests to internal services based on defined rules. These rules typically inspect the host header (e.g., api.example.com) and the request path (e.g., /v1/users).

  • Path-Based Routing: Directs traffic to different backend services based on the URL path. For example, /web goes to the frontend service, while /api goes to the backend API service.
  • Host-Based Routing: Directs traffic based on the domain name, allowing multiple websites or subdomains to be served from the same cluster IP address.
  • Default Backend: A catch-all service that handles requests that do not match any of the defined rules.
02

SSL/TLS Termination

Ingress controllers can handle the decryption of HTTPS traffic, offloading the cryptographic workload from the backend services. This is managed via Ingress TLS specifications.

  • Certificate Management: The Ingress references a Kubernetes Secret object that contains the TLS private key and certificate (e.g., a .crt and .key file).
  • Centralized Security: SSL termination at the Ingress layer simplifies certificate management and renewal for all services behind it.
  • Supports SNI: Modern Ingress controllers support Server Name Indication (SNI), allowing multiple TLS certificates to be hosted on a single IP address, essential for host-based routing with HTTPS.
03

Load Balancing

An Ingress controller provides load balancing functionality, distributing client requests across all healthy pods backing a service. This is a critical feature for scalability and high availability.

  • Session Affinity: Also known as sticky sessions, this feature ensures requests from the same client are directed to the same backend pod, which is necessary for stateful applications.
  • Algorithm Variety: Common load balancing algorithms include round-robin, least connections, and IP hash.
  • Health Check Integration: The load balancer uses readiness probes from the Kubernetes pods to determine which backends are eligible to receive traffic, preventing requests from being sent to failing instances.
04

Ingress Controller

The Ingress resource defines the rules, but an Ingress Controller is the actual process that fulfills those rules. It is a specialized load balancer implementation running as a pod in the cluster.

  • Implementation Variants: Popular controllers include NGINX Ingress Controller, Traefik, HAProxy Ingress, and cloud-provider specific ones like AWS ALB Ingress Controller and GKE Ingress.
  • Dynamic Configuration: The controller watches the Kubernetes API for changes to Ingress resources and updates its configuration (e.g., an NGINX config file) in real-time.
  • Requires a Service: The controller itself is exposed via a Kubernetes Service of type LoadBalancer or NodePort to receive external traffic.
05

Name-Based Virtual Hosting

This feature allows multiple domain names or subdomains to be served from a single public IP address, a fundamental capability for modern web hosting on Kubernetes.

  • Host Rule: An Ingress rule specifies a host field (e.g., blog.example.com). The Ingress controller matches the HTTP Host header in the incoming request to this rule.
  • Cost and IP Efficiency: Eliminates the need for a unique public IP address per website or service, conserving IPv4 addresses and reducing cloud infrastructure costs.
  • Example Rule:
yaml
rules:
- host: "app.company.com"
  http:
    paths:
    - path: "/"
      pathType: Prefix
      backend:
        service:
          name: frontend-svc
          port:
            number: 80
06

Annotations & Customization

Ingress behavior is extensively customized using annotations. These are key-value pairs attached to the Ingress manifest that provide instructions to the specific Ingress Controller.

  • Controller-Specific: Annotations are not standardized by the Kubernetes API; their function depends on the controller implementation. For example, nginx.ingress.kubernetes.io/rewrite-target is specific to the NGINX controller.
  • Common Customizations:
    • Rate Limiting: Configuring requests-per-second limits per client or service.
    • CORS: Enabling Cross-Origin Resource Sharing headers.
    • Authentication: Basic auth, OAuth, or external auth URL configuration.
    • Custom Timeouts: Setting proxy connect, read, and send timeouts.
  • Alternative to IngressClass: Before the IngressClass resource, annotations like kubernetes.io/ingress.class: "nginx" were used to designate which controller should handle the Ingress.
NETWORKING ABSTRACTION

Ingress vs. Kubernetes Service

A comparison of the two primary Kubernetes objects for exposing applications to network traffic, highlighting their distinct roles in the cluster's networking stack.

FeatureKubernetes Service (ClusterIP, NodePort, LoadBalancer)Ingress

Primary Purpose

Defines a stable endpoint and load balancing for a set of pods within the cluster.

Manages external HTTP/HTTPS access to services, acting as a smart HTTP router.

OSI Layer

Primarily Layer 4 (TCP/UDP). LoadBalancer Services can integrate with Layer 7 features via cloud provider annotations.

Layer 7 (HTTP/HTTPS). Routes based on host, path, headers, and other HTTP attributes.

Traffic Routing Logic

Basic load balancing (e.g., round-robin) across pod IPs based on the Service's selector.

Advanced, rule-based routing (e.g., example.com/api -> backend-service:8080).

SSL/TLS Termination

Name-Based Virtual Hosting

Required Implementation

Core Kubernetes component (kube-proxy or cloud provider load balancer).

Requires an Ingress Controller (e.g., NGINX, Traefik, HAProxy) to fulfill the Ingress spec.

External Access Method

ClusterIP: Internal only. NodePort: Access via any node's IP:port. LoadBalancer: Cloud-provisioned external IP.

Via the Ingress Controller's external IP or hostname, defined by the controller's Service (often LoadBalancer type).

Typical Use Case

Internal service discovery and load balancing; exposing a stateful service like a database.

Exposing multiple web applications, APIs, or microservices under a single IP with URL-based routing and TLS.

INGRESS

Frequently Asked Questions

Ingress is a core Kubernetes API object for managing external access to services within a cluster. It acts as a smart traffic router, providing essential features like load balancing, SSL/TLS termination, and host-based routing. This FAQ addresses common questions about its role, configuration, and operation in modern, cloud-native deployments.

An Ingress is a Kubernetes API object that manages external HTTP and HTTPS access to services running inside a cluster. It functions as a layer 7 (application layer) traffic router, exposing HTTP and HTTPS routes from outside the cluster to services within.

It works by defining a set of rules. An Ingress Controller, a dedicated pod running in the cluster, watches for Ingress resource definitions. When you create an Ingress manifest, the controller reads its rules and configures an underlying load balancer or proxy (like NGINX, Traefik, or an AWS Application Load Balancer) to enforce those rules. A typical rule specifies:

  • A host (e.g., api.example.com)
  • A path (e.g., /v1/users)
  • A backend service and port to route matching traffic to.

For example, traffic to https://app.example.com/dashboard can be routed to the frontend-service on port 80, while traffic to https://app.example.com/api is routed to the backend-service.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.