Available in: CE, BE, SE, SE+, EE
The module lifecycle stage: Preview
The module has requirements for installation
The alb module implements an Application Load Balancer (ALB) and allows you to publish applications through Kubernetes Gateway API. It deploys and configures the infrastructure for receiving and routing external requests, and also verifies the user configuration of the Gateway API.
The current version of Envoy Proxy in use is v1.38.3.
The module supports:
- traffic balancing across multiple protocols;
- automatically creating and flexibly configuring infrastructure for Gateway objects (a service resource for configuring the traffic entry point into the cluster);
- handling incoming requests with ListenerSet objects (a custom resource);
- routing incoming requests with HTTPRoute, GRPCRoute, TCPRoute, UDPRoute, and TLSRoute objects (custom resources);;
- validating Gateway API configuration.
This module can be used in a cluster alongside the ingress-nginx module. For more information, see the Admin guide.
Advantages of the Gateway API approach
The module is built on the Kubernetes Gateway API, the modern standard for managing inbound traffic that succeeds the Ingress API. Building on this standard, the module provides:
- a single declarative API for several protocols at once (HTTP/HTTPS, gRPC, TCP, UDP, and TLS passthrough), including scenarios that the Ingress API does not cover;
- a separation of responsibilities between the cluster administrator (infrastructure through ClusterALBInstance and ALBInstance), the namespace administrator (traffic handling through ListenerSet), and the application team (routing through HTTPRoute and other route objects), which simplifies multitenancy;
- extended request-handling capabilities out of the box: per-route WAF (ModSecurity/Coraza), external authentication, allowlists of source IP addresses, request rate limiting, session affinity, GeoIP, BackendTLSPolicy, Proxy Protocol, and HTTP/3.
The module can run in a cluster alongside the ingress-nginx module, so the Gateway API can be adopted gradually: new applications are published through the module while existing ones keep their current scheme.
Difference between the Kubernetes Gateway API and an API gateway
Despite the similar names, these are different concepts:
- The Kubernetes Gateway API is a set of Kubernetes resources (a specification) that describe how inbound traffic is routed to services. It is a configuration interface implemented by controllers, and the successor to the Ingress API.
- An API gateway is an architectural component (or product) that aggregates several application APIs behind a single entry point and centralizes cross-cutting functions such as authentication, authorization, and request rate limiting for API consumers.
In other words, the Kubernetes Gateway API describes how to configure traffic routing, while an API gateway is a type of infrastructure that handles that traffic. Some API gateways can be configured through the Kubernetes Gateway API. The alb module is an implementation of the Kubernetes Gateway API.
Comparison of the ingress-nginx and alb modules
Both modules solve the same task — receiving and routing external traffic to applications — but rely on different standards: ingress-nginx uses the Ingress API with annotations, while alb uses the Kubernetes Gateway API. The modules can be used in a cluster simultaneously (for more information, see the Admin guide). The table below compares their capabilities in the current versions.
| Capability | ingress-nginx |
alb |
|---|---|---|
| Routing standard | Ingress API with annotations | Kubernetes Gateway API |
| Proxy implementation | nginx | Envoy Proxy |
| Lifecycle stage | General Availability | Preview |
| Development | Maintenance mode: the upstream Ingress NGINX project no longer develops new features, while DKP provides security updates | Actively developed |
| Minimum DKP version | Available in all supported versions | 1.76 |
| DKP editions | All editions | All editions |
| Role separation model | cluster administrator, namespace administrator | cluster administrator, namespace administrator, application team |
| Multiple independent entry points | Multiple Ingress controllers selected via ingressClass |
Multiple Gateway objects selected via gatewayName; cluster-scoped and namespaced gateways |
| HTTP/HTTPS (HTTP/1.1, HTTP/2, HTTP/3) | Yes | Yes |
| WebSocket | Yes | Yes |
| gRPC | Yes | Yes |
| FastCGI | Yes | No |
| TCP | No | Yes (TCPRoute) |
| UDP | No | Yes (UDPRoute) |
| TLS passthrough | Yes | Yes (TLSRoute) |
| Proxy Protocol | Yes | Yes |
| Traffic ingress methods | LoadBalancer, HostNetwork and HostPort inlets |
LoadBalancer and HostPort inlets |
| Automatic TLS certificate issuance (cert-manager) | Yes | Yes |
| HTTPS policy tuning (TLS versions, ciphers, HSTS) | Yes | TLSv1.2/1.3 by default; HSTS via a response-header annotation |
| WAF | ModSecurity at the controller or Ingress level | ModSecurity/Coraza at the route level, OWASP CRS preset |
| External authentication | Yes | Yes |
| IP allowlist | Yes | Yes |
| Basic authentication | Yes | Yes |
| Request rate limiting | Yes | Yes |
| Session affinity | Yes | Yes |
| GeoIP | Geo-based request statistics in metrics | Request enrichment with headers based on MaxMind databases |
| Prometheus metrics and Grafana dashboards | Yes, detailed by namespace, vhost, Ingress resource, and location | Yes: Envoy Proxy metrics and dashboards for requests, routes, and upstreams |
| OpenTelemetry tracing | Yes | Yes |
Traffic balancing across multiple protocols
The module allows using the following protocols for receiving and further routing traffic:
- HTTP/HTTPS: The main traffic routing protocols. HTTP/1.1 and HTTP/2 are supported by default. HTTP/3 can be enabled via the ALBInstance and ClusterALBInstance parameters.
- WebSocket: Supported natively by Envoy Proxy, without additional configuration by the user.
- gRPC: Routing of gRPC routes is supported via GRPCRoute.
- Proxy Protocol: Receiving Proxy Protocol traffic is supported by utilizing the corresponding parameters in ALBInstance and ClusterALBInstance.
- SSL Passthrough: End-to-end routing of SSL traffic is supported via TLSRoute.
- TCP: Routing of TCP traffic is supported via TCPRoute.
- UDP: Routing of UDP traffic is supported via UDPRoute.
SSL/TLS Support
By default, Envoy Proxy supports TLSv1.2 and TLSv1.3. When using TLSv1.2, the following cryptographic parameters are applied:
- Key exchange: ECDHE;
- Authentication: ECDSA, RSA;
- Encryption (AEAD): AES-GCM (128/256), ChaCha20-Poly1305;
- Integrity check: SHA256, SHA384.
When using TLSv1.3, the cryptographic protocol suite is determined by the BoringSSL library.
Monitoring and statistics
The alb module collects Envoy Proxy metrics and exposes them to Prometheus in Prometheus format. When the operator-prometheus module is enabled, the d8-alb-proxy PodMonitor scrapes the /stats/prometheus endpoint from every ready ALB proxy pod. The collected metrics are exported with the d8_alb_gateway_ prefix.
Depending on the metric, the data can be grouped by:
namespace;gateway;clusteralbinstance;hostname;route;response_code;methodfor the HTTP request counter by method;countryfor GeoIP metrics;cityfor GeoIP metrics by city;cluster_namefor upstream clusters;nodeandtierfor proxy target metadata.
The graphs are collected in Grafana dashboards stored in monitoring/grafana-dashboards/alb:
requests.json(Requests) provides an overview of HTTP requests, HTTP methods, HTTP, TCP, and UDP traffic, a country map and Top cities for GeoIP requests, errors, upstreams, TLS, and listeners;route-details.json(Route Details) provides drill-down statistics for a selected route, including request count, RPS, HTTP traffic, P50/P95/P99 latency, response codes, and error signals;upstream-details.json(Upstream Details) provides drill-down statistics for a selected upstream cluster, including request count, latency, retries, timeouts, connection failures, pending requests, and healthy endpoints.
Basic principles of collecting statistics
- Envoy Proxy generates standard metrics and custom HTTP statistics. Custom request statistics include the route, requested hostname, and response code as metric labels.
- Envoy Proxy exposes metrics at
/stats/prometheus. The ALB proxy’skube-rbac-proxymakes this endpoint available on thehttps-metricsport and authorizes access to the corresponding proxy workload. Gateway controller metrics are also published through itskube-rbac-proxy. - When
operator-prometheusis enabled, thed8-alb-proxyandd8-alb-gateway-controllerPodMonitors scrape ALB proxy and Gateway controller metrics; metric names are prefixed withd8_alb_gateway_. - Grafana dashboards query the resulting Prometheus metrics and provide filters for namespace, gateway, ALB instance, hostname, route, response code, or upstream cluster.
What information does Prometheus collect, and in what form
- HTTP:
d8_alb_gateway_envoy_http_custom_downstream_rq_by_pathcounts requests withroute,hostname, andresponse_codelabels;d8_alb_gateway_envoy_http_custom_downstream_rq_by_methodcounts requests withmethod,route, andhostnamelabels;d8_alb_gateway_envoy_http_custom_downstream_rq_{rx,tx}_bytes_totalcounts received and sent HTTP traffic;d8_alb_gateway_envoy_http_custom_downstream_rq_duration_by_path_{sum,count,bucket}records request duration; no-route, no-cluster, timeout, and downstream reset metrics expose error signals; - GeoIP:
d8_alb_gateway_envoy_http_custom_geoip_requestscounts HTTP requests by thecountrylabel;d8_alb_gateway_envoy_http_custom_geoip_requests_by_citycounts them bycountryandcity. The first metric is created when GeoIP City DB andgeoIP.headers.countryare configured; the second additionally requiresgeoIP.headers.city. - GeoIP status:
d8_alb_gateway_geoip_configuredis1when an ALBInstance has a configured GeoIP database source (GeoProxy or a direct mirror), and0otherwise. It is shown in the GeoIP status panel of theRequestsdashboard; it reports configuration, not database readiness or freshness. - Upstream:
d8_alb_gateway_envoy_cluster_upstream_rq_time_{sum,count,bucket}records upstream latency; request totals, retries, retry overflows, timeouts, connection failures, active and pending requests, resets, and healthy endpoint counts are also collected; - Listener and TLS:
d8_alb_gateway_envoy_listener_downstream_cx_activeandd8_alb_gateway_envoy_listener_ssl_certificate_*expose active downstream connections and TLS certificate statistics; - TCP:
d8_alb_gateway_envoy_tcp_custom_downstream_cx_totalandd8_alb_gateway_envoy_tcp_downstream_cx_{rx,tx}_bytes_totalexpose connection counts and traffic volume; - UDP:
d8_alb_gateway_envoy_cluster_udp_sess_{rx,tx}_datagramsexpose received and transmitted datagrams for UDP sessions.
Automatically creating and flexibly configuring infrastructure for Gateway objects
The module provides two custom resources (CRDs) for declarative description and management of infrastructure for Gateway objects: ClusterALBInstance and ALBInstance. The characteristics of these resources and the differences between them are described in the table below.
| ClusterALBInstance | ALBInstance | |
|---|---|---|
| Purpose | Deploy a cluster-wide Gateway object | Deploy a local Gateway object |
| Typical use case | Shared entry point, system (for publishing DKP service components) or platform gateway | Dedicated gateway for an application or team in a dedicated namespace |
| Supported inlet types | LoadBalancer, HostPort |
LoadBalancer |
| Proxy implementation | Envoy Proxy | Envoy Proxy |
| Deployment type | DaemonSet | Deployment |
| Placement of ListenerSet objects and routes | In any user namespace | In the same namespace as the ALBInstance object |
| Access level | Cluster administrator | Namespace administrator |
Creating ALBInstance resources is available in the following editions: EE, BE, SE, SE+, CSE.
Creating a ClusterALBInstance object or an ALBInstance object results in creation of a managed Gateway object in the cluster. At the same time:
- Each Gateway object is served by at least one Envoy Proxy instance.
- Traffic reaches it through a Service object of type
LoadBalanceror directly by usingHostPortparameters. - Each Gateway object creates two default listeners:
d8-http(port80) andd8-https(port443). They are intended for service tasks such as gateway availability checks orcert-managerHTTP-01 challenges. They are not recommended for publishing applications; use ListenerSet for that purpose instead.
Manual modification of Gateway objects managed by the module is not allowed.
Several ClusterALBInstance objects or ALBInstance objects may point to the same Gateway object through the gatewayName field. In that case, they describe one shared gateway, but the request handling infrastructure may differ depending on settings. You can think of gatewayName as an analogue of ingressClass for IngressNginxController objects.
Handling incoming requests with ListenerSet objects
The ListenerSet object describes system and user traffic handlers that define hostname, TLS mode, port, and protocol. Each ListenerSet object is linked to a specific parent Gateway object through the spec.parentRef field, and routes are then attached to it.
Placement of ListenerSet objects depends on the type of Gateway object in use:
- for ClusterALBInstance, ListenerSet objects may be placed in any namespace;
- for ALBInstance, ListenerSet objects are recommended to be placed in the same namespace.
In both cases, it is recommended to place the ListenerSet object in the same namespace as the HTTPRoute, GRPCRoute, and TLSRoute objects attached to it. This improves configuration readability and helps avoid additional setup such as ReferenceGrant objects.
TCPRoute and UDPRoute objects for plain TCP/UDP ports defined in additionalPorts are attached directly to the corresponding managed Gateway listener, rather than to a ListenerSet. This gives network administrators finer control over which additional ports are exposed in the cluster. For details, see Opening an additional TCP/UDP port in the Administrator guide.
Routing incoming requests with HTTPRoute, GRPCRoute, TCPRoute, UDPRoute, and TLSRoute objects
At the moment, the module supports the following route types:
- HTTPRoute: For routing HTTP/HTTPS/TLS requests.
- GRPCRoute: For routing gRPC traffic.
- TLSRoute: For TLS passthrough routing.
- TCPRoute: For routing TCP traffic (plain TCP via a Gateway listener from
additionalPorts, or after TLS termination on a ListenerSet). - UDPRoute: For routing UDP traffic via a Gateway listener from
additionalPorts.
HTTPRoute objects support extended settings through annotations that complement the current Gateway API specification.
Validating Gateway API configuration
In addition to Gateway API infrastructure configuration, the module validates user settings to prevent conflicting configurations from being applied. For example, the module checks for conflicts between identical traffic handlers in different ListenerSet objects when they point to the same Gateway object.