Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Application Load Balancer
  • Getting started
    • Overview
      • Overview
      • Installing the Gateway API
    • Configuring security groups
    • Working with service accounts
    • Creating and updating resources via Ingress controller configurations
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • L7 load balancer logs
  • Release notes

In this article:

  • Route order in virtual hosts
  • Sample configuration
  • Installation and requirements
  1. Tools for Managed Service for Kubernetes
  2. Gateway API
  3. Overview

Gateway API for Managed Service for Kubernetes

Written by
Yandex Cloud
Updated at May 20, 2025
  • Route order in virtual hosts
  • Sample configuration
  • Installation and requirements

Application Load Balancer provides the Gateway API tool for creating and managing load balancers in Yandex Managed Service for Kubernetes clusters. To learn more about the Gateway API project, visit its official website.

Once you install the Gateway API, you can use it to create a Gateway and its associated HTTPRoute resources:

  • The Gateway resource is managed by the cluster operator. It configures incoming traffic reception and route selection rules, i.e., HTTPRoute resources. The system creates an L7 load balancer to handle traffic for the Gateway. The load balancer uses HTTP routers to route incoming traffic.
  • The HTTPRoute resources are managed by Kubernetes service developers and describe routes for the incoming traffic that can be routed to a Kubernetes backend service or redirected to another URI. With HTTPRoute you can create virtual hosts and routes in HTTP routers and backend groups.

For more detials about configuring resources via Gateway API, see the following sections:

  • Gateway: Rules for receiving and routing incoming traffic using HTTPRoute resources.
  • HTTPRoute: Traffic routing and redirection rules.
  • Service: Kubernetes backend service description.

Route order in virtual hostsRoute order in virtual hosts

Route order in virtual hosts is determined by the Gateway API algorithm sorting routes by the level of precision with which their match conditions align with the incoming HTTP request.

Match conditions in descending priority order:

  1. Exact path match.
  2. Longest path prefix match.
  3. Method match.
  4. Most matching headers.
  5. Most matching query parameters.

Routes from different HTTPRoute resources with equal precedence are prioritized first by creation timestamp (older routes first), then by name in {namespace}/{name} format.

If there remain routes with equal precedence in the same HTTPRoute resource, the system will select the first matching route from the list.

For requests matching none of the rules associated with the current parent element, the system will return 404 error.

The route order determines the request processing logic.

Sample configurationSample configuration

Below you can see a sample Gateway and HTTPRoute resource configuration describing a load balancer that receives HTTPS requests and routes them to one of two service backends based on their URI paths.

Example
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: alb-gwapi-gw
spec:
  gatewayClassName: yc-df-class
  listeners:
    - name: alb-gwapi-listener
      protocol: HTTPS
      port: 443
      hostname: <domain_name>
      allowedRoutes:
        namespaces:
          from: Selector
          selector:
            matchLabels:
              gatewayName: alb-gwapi-gw
      tls:
        certificateRefs:
          - kind: Secret
            group: ""
            name: alb-gwapi-cert
            namespace: alb-gwapi-ns
---
apiVersion: v1
kind: Namespace
metadata:
  name: alb-gwapi-apps-ns
  labels:
    gatewayName: alb-gwapi-gw

---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: alb-gwapi-route
  namespace: alb-gwapi-apps-ns
spec:
  hostnames:
    - "<domain_name>"
  parentRefs:
    - name: alb-gwapi-gw
      namespace: default
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /app1
      backendRefs:
        - name: alb-demo-1
          port: 80
    - matches:
        - path:
            type: PathPrefix
            value: /app2
      backendRefs:
        - name: alb-demo-2
          port: 80
    - backendRefs: # Default match (implicit "/" path prefix)
        - name: alb-demo-2
          port: 80

Installation and requirementsInstallation and requirements

To install the Gateway API, you need:

  • Managed Service for Kubernetes cluster.
  • Cluster node group.
  • Cluster namespace to store your service account key.

To learn how to install the Gateway API, see this guide.

See alsoSee also

  • Security group configuration for a Kubernetes cluster and a load balancer.
  • Service account to support controller operation.
  • Gateway API in Yandex Cloud Marketplace.

Was the article helpful?

Previous
Ingress service
Next
Installing the Gateway API
Yandex project
© 2025 Yandex.Cloud LLC