Yandex Cloud
Поиск
Связаться с экспертомПопробовать бесплатно
  • Кейсы
  • Документация
  • Блог
  • Все сервисы
    • 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 Neurosupport
    • Yandex Cloud Detection and Response
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • GOST Gateway
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • SourceCraft
    • 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
  • Статус работы сервисов
  • Marketplace
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Искусственный интеллект
    • Безопасность
    • Инструменты DevOps
    • Бессерверные вычисления
    • Управление ресурсами
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Yandex Cloud Trust
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Калькулятор цен
    • Тарифы
    • Акции и free tier
  • Кейсы
  • Документация
  • Блог
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ООО «Яндекс.Облако»
Yandex Application Load Balancer
  • Начало работы
    • Обзор
      • Обзор
      • Установка Gwin
      • Политики Gwin
      • Миграция приложений с ALB Ingress-контроллера на Gwin
      • Механизм Attachment для интеграции Gwin с Application Load Balancer
        • BackendTLSPolicy
        • DirectResponse
        • GRPCRoute
        • HTTPRoute
        • Gateway
        • GatewayPolicy
        • IngressBackendGroup
        • Ingress
        • IngressPolicy
        • ListenerSetPolicy
        • ListenerSet
        • Service
        • ServicePolicy
        • YCCertificate
        • TLSRoute
        • YCStorageBucket
        • RoutePolicy
    • Настройка групп безопасности
    • Работа с сервисными аккаунтами
    • Создание и изменение ресурсов по конфигурации
  • Управление доступом
  • Правила тарификации
  • Справочник Terraform
  • Метрики Monitoring
  • Аудитные логи Audit Trails
  • Логи L7-балансировщика
  • История изменений
  • Обучающие курсы

В этой статье:

  • Cheatsheet
  • DirectResponseSpec
  • DirectResponseBody
  1. Инструменты для Managed Service for Kubernetes
  2. Gwin
  3. Конфигурация ресурсов (англ.)
  4. DirectResponse

DirectResponse

Статья создана
Yandex Cloud
Обновлена 3 июля 2026 г.
Открыть в 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

Примечание

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

Была ли статья полезна?

Предыдущая
BackendTLSPolicy
Следующая
GRPCRoute
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ООО «Яндекс.Облако»