Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Application Load Balancer
  • Getting started
    • Overview
      • Overview
      • Installing the Gateway API
        • Gateway
        • GatewayPolicy
        • HTTPRoute
        • GRPCRoute
        • RoutePolicy
        • TLSRoute
        • Gateway API service
        • YCCertificate
        • YCStorageBucket
    • 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:

  • GatewayPolicy
  • Gateway
  1. Tools for Managed Service for Kubernetes
  2. Gateway API
  3. Resource configuration
  4. GatewayPolicy

GatewayPolicy resource fields

Written by
Yandex Cloud
Updated at July 20, 2026
View in Markdown
  • GatewayPolicy
  • Gateway

The GatewayPolicy resource specifies cloud policies applied to Gateway resources within a single Kubernetes namespace. You can apply a policy to specific resources with the help of references (targetRefs) or a selector (selector). If neither of these fields is set, the policy applies to all the resources within the namespace.

Tip

We recommend using the new Yandex Cloud Gwin controller instead of an ALB Ingress controller and Gateway API.

GatewayPolicy is a Gateway API extension implemented in Application Load Balancer. Below, we describe its fields and annotations used by the Application Load Balancer Gateway API.

Note

You can also set up your policies using Gateway resource annotations. The GatewayPolicy resource parameters and Gateway annotations are equivalent.

Here is an example of the GatewayPolicy resource definition we provide only to demonstrate all the parameters:

apiVersion: gateway.alb.yc.io/v1
kind: GatewayPolicy
metadata:
  name: my-gateway-policy
spec:
  targetRefs:
    - name: some-gateway
      kind: Gateway
      group: gateway.networking.k8s.io
  
  selector:
    matchLabels:
      app: my-app

  policy:
    subnets: ["subnet-id-1", "subnet-id-2"]
    securityGroups: ["sg-id-1", "sg-id-2"]

    logs:
      logGroupID: "some-log-group-id"
      disable: false                 
      discardRule:
        http-errors:                 
          httpCodes: [404, 500]  
          httpCodeIntervals: ["4XX", "5XX"]
          discardPercent: 100   

    autoScale:
      minZoneSize: 2
      maxSize: 10 

    zone:
      ru-central1-a:  
        receiveTraffic: true

GatewayPolicyGatewayPolicy

apiVersion: gateway.alb.yc.io/v1
kind: GatewayPolicy
metadata:
  name: <string>
  namespace: <string>
spec:
  targetRefs:
    - name: <string>
      kind: <string>
      group: <string>
  selector:
    matchLabels:
      <string>: <string>
    matchExpressions:
      - key: <string>
        operator: <string>
        values:
          - <string>
  policy:
    subnets: [...]
    securityGroups: [...]
    logs: ...
    autoScale: ...
    zone: ...
status:
  conditions: [...]
  attachedGateways: <integer>

Where:

  • apiVersion: gateway.alb.yc.io/v1

  • kind: GatewayPolicy

  • metadata (ObjectMeta; this is a required field)

    Resource metadata.

    • name (string; this is a required field)

      Resource name. The format is described in this Kubernetes guide.

    • namespace (string)

      Namespace the resource belongs to. The default value is default.

  • spec (GatewayPolicySpec; this is a required field)

    Policy specification.

    • targetRefs ([]LocalObjectReference)

      List of references to resources targeted by the policy. If specified, the policy applies only to these resources.

    • selector (LabelSelector)

      Selector for selecting resources by label. If specified, the policy applies only to selected resources.

    • policy (Gateway)

      Cloud configuration applied to selected resources. See details below.

  • status (GatewayPolicyStatus)

    Current status of the policy.

    • conditions: Array of status conditions. The format is described in this Kubernetes guide.

    • attachedGateways: Number of attached Gateway resources.

GatewayGateway

Resource defining the load balancer's cloud parameters that can be set using a policy.

subnets: [<string>, ...]
securityGroups: [<string>, ...]
logs:
  logGroupID: <string>
  disable: <bool>
  discardRule:
    <rule_name>:
      httpCodes: [<int>, ...]
      httpCodeIntervals: [<string>, ...]
      grpcCodes: [<string>, ...]
      discardPercent: <int>
autoScale:
  minZoneSize: <int>
  maxSize: <int>
zone:
  <availability_zone>:
    receiveTraffic: <bool>

Where:

  • subnets ([]string)

    List of Virtual Private Cloud subnets in the load balancer's availability zones. This is a comma separated list of subnet IDs.

  • securityGroups ([]string)

    List of load balancer's Virtual Private Cloud security groups. This is a comma separated list of group IDs.

    For the proper load balancer and Gateway API operation, make sure to configure security groups as specified in Configuring security groups for Managed Service for Kubernetes Application Load Balancer tools.

  • logs (LogOptions)

    Load balancer logging parameters.

    • logGroupID (string)

      ID of the log group to write load balancer logs to in Yandex Cloud Logging.

    • disable (bool)

      Disables logging.

    • discardRule (map[string]string)

      Log discard rules.

      • httpCodes ([]int)

        HTTP codes to discard.

      • httpCodeIntervals ([]string)

        HTTP code groups to discard, e.g., 4xx.

      • grpcCodes ([]string)

        gRPC codes to discard.

      • discardPercent (int)

        Percentage of logs to discard (0 to retain all, 100 to discard all).

  • autoScale (AutoScalePolicy)

    Load balancer scaling parameters.

    • minZoneSize (int)

      Minimum number of resource units per availability zone. The default minimum is 2. You cannot set a limit lower than two resource units per zone.

    • maxSize (int)

      Maximum total number of resource units.

  • zone (map[string]string)

    Parameters for specific availability zones.

    • receiveTraffic (bool)

      If true, traffic to the load balancer nodes in this zone is disabled.

Was the article helpful?

Previous
Gateway
Next
HTTPRoute
© 2026 Direct Cursus Technology L.L.C.