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 Gwin
      • Gwin policies
      • Migrating apps from an ALB Ingress controller to Gwin
      • Attachment mechanism for Gwin integration with Application Load Balancer
        • BackendTLSPolicy
        • DirectResponse
        • GRPCRoute
        • HTTPRoute
        • Gateway
        • GatewayPolicy
        • IngressBackendGroup
        • Ingress
        • IngressPolicy
        • ListenerSetPolicy
        • ListenerSet
        • Service
        • ServicePolicy
        • YCCertificate
        • TLSRoute
        • YCStorageBucket
        • RoutePolicy
    • 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:

  • Cheatsheet
  • DirectResponseSpec
  • DirectResponseBody
  1. Tools for Managed Service for Kubernetes
  2. Gwin
  3. Resource configuration
  4. DirectResponse

DirectResponse

Written by
Yandex Cloud
Updated at July 3, 2026
View in Markdown
  • Cheatsheet
  • DirectResponseSpec
    • DirectResponseBody

DirectResponse is a Gwin custom resource that instructs the load balancer to return a fixed HTTP response directly to the client, without forwarding the request to any backend service.

It is referenced from an HTTPRoute rule via an ExtensionRef filter. This makes it conceptually similar to RequestRedirect — both are terminal route actions that short-circuit normal backend routing.

Typical use cases: returning 404 Not Found for unknown paths, 503 Service Unavailable during maintenance, or any other static response.

  • Cheatsheet
  • DirectResponseSpec
    • DirectResponseBody

CheatsheetCheatsheet

apiVersion: gwin.yandex.cloud/v1
kind: DirectResponse
metadata:
  name: not-found-response
  namespace: example-ns
spec:
  responseCode: 404          # HTTP status code to return
  responseBody:
    text: "Path not found"   # optional plain-text body

Reference from an HTTPRoute rule via ExtensionRef filter:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: example-route
  namespace: example-ns
spec:
  parentRefs:
    - name: example-gateway
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /unknown
      filters:
        - type: ExtensionRef
          extensionRef:
            group: gwin.yandex.cloud
            kind: DirectResponse
            name: not-found-response  # must be in the same namespace as the HTTPRoute

Note

A rule that uses a DirectResponse filter must not include backendRefs — the direct response replaces normal backend routing entirely.

Field Description
metadata ObjectMeta
Standard Kubernetes metadata.
spec DirectResponseSpec
Direct response specification.

DirectResponseSpecDirectResponseSpec

DirectResponseSpec defines the HTTP response to be returned to the client.

Appears in: DirectResponse

Field Description
responseCode integer
HTTP status code to return.
Example: 404, 503.
responseBody DirectResponseBody
Optional response body. If omitted, the response has an empty body.

DirectResponseBodyDirectResponseBody

DirectResponseBody defines the plain-text content of the response body.

Appears in: DirectResponseSpec

Field Description
text string
Plain-text body content.
Example: Path not found

Was the article helpful?

Previous
BackendTLSPolicy
Next
GRPCRoute
© 2026 Direct Cursus Technology L.L.C.