What Is Kubernetes Ingress Used For?
Kubernetes Ingress is used to manage external access to the services within a Kubernetes cluster. Ingress delivery in Kubernetes has changed significantly over time, starting with the early Ingress API to today, where Envoy Gateway is the leading choice to deliver Ingress services via the Kubernetes Gateway API.
The Kubernetes Ingress API and the Kubernetes Gateway API both serve to manage and route external traffic to services within a Kubernetes cluster, but they have different scopes, capabilities, and design philosophies.
Kubernetes Ingress is used to manage external access to the services within a Kubernetes cluster. It acts as an entry point for external traffic, routing it to the appropriate services based on the configured rules. Here’s a breakdown of its main purposes:
HTTP and HTTPS Routing: Ingress allows you to define rules for routing HTTP and HTTPS traffic to different services based on hostnames or paths.
Load Balancing: It can distribute incoming traffic across multiple instances of a service, providing load balancing capabilities to ensure even distribution of traffic and high availability.
SSL/TLS Termination: Ingress can handle SSL/TLS termination, meaning it can manage HTTPS connections by handling SSL certificates and decrypting traffic before passing it to the backend services.
Name-Based Virtual Hosting: Ingress supports name-based virtual hosting, which allows you to direct traffic to different services based on the hostname specified in the request.
Centralized Traffic Management: It provides a centralized point for defining and managing how traffic should flow into your cluster, making it easier to handle complex routing and traffic management requirements.
The Kubernetes Gateway API, the successor to and superset of the older Ingress API, is used to provide a more flexible and extensible way to manage and control traffic routing within a Kubernetes cluster, compared to the traditional Ingress API. Here are the key purposes and features of the Gateway API:
Advanced Traffic Management: The Gateway API supports more advanced traffic routing and management capabilities, such as traffic splitting, retries, timeouts, and advanced load balancing strategies.
Separation of Concerns: It separates the concerns of configuring how traffic enters the cluster (Gateway resources) from how traffic is routed within the cluster (HTTPRoute, TCPRoute, etc.). This allows different teams to manage their specific aspects more effectively.
Flexibility and Extensibility: The Gateway API is designed to be more extensible, enabling the integration of various service mesh and networking implementations. It provides a more flexible architecture that can accommodate future enhancements and new use cases.
Role-Specific Resources: The Gateway API introduces role-specific resources, such as Gateways, GatewayClasses, and Routes. Gateways define where traffic enters the cluster, GatewayClasses define types of gateways, and Routes define how traffic should be routed to services.
Better Integration with Service Meshes: The API is designed to integrate well with service meshes, providing a unified way to manage ingress and egress traffic as well as service-to-service communication within the cluster.
Enhanced Security: The Gateway API provides more granular control over security policies, such as configuring TLS settings and defining security requirements for different types of traffic.
Learn More
- To learn more about the Gateway API and how it works for Kubernetes ingress, read Why the Gateway API is the Unified Future of Ingress for Kubernetes and Service Mesh ›
- Read our Envoy Gateway overview to get started with Kubernetes ingress using the Gateway API ›