본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

MeshGateway 타임아웃 조정

원문 보기 위키 갱신

MeshGateway 타임아웃 조정 (MeshProxyPatch)

MeshProxyPatch 리소스를 사용해 MeshGateway의 streamIdleTimeout 값을 변경하는 방법을 설명해요. Kubernetes, Universal, Terraform 세 가지 환경별로 동일한 패치 설정을 작성하는 예시를 차례로 보여줘요. Envoy의 http_connection_manager 필터에 JSON 패치를 적용해 타임아웃을 15초로 조정하는 전체 흐름을 예제 코드와 함께 확인할 수 있어요

출처: 문서

본문

MeshGateway의 타임아웃 조정

MeshGateway의 streamIdleTimeout을 변경하는 예제예요.

구성

Kubernetes

apiVersion: kuma.io/v1alpha1
kind: MeshProxyPatch
metadata:
  name: custom-template-1
  namespace: kong-mesh-system
  labels:
    kuma.io/mesh: default
spec:
  targetRef:
    kind: MeshGateway
    name: gateway
  default:
    appendModifications:
    - networkFilter:
        operation: Patch
        match:
          name: envoy.filters.network.http_connection_manager
          origin: gateway
        jsonPatches:
        - op: replace
          path: "/streamIdleTimeout"
          value: 15s

Universal

type: MeshProxyPatch
mesh: default
name: custom-template-1
spec:
  targetRef:
    kind: MeshGateway
    name: gateway
  default:
    appendModifications:
    - networkFilter:
        operation: Patch
        match:
          name: envoy.filters.network.http_connection_manager
          origin: gateway
        jsonPatches:
        - op: replace
          path: "/streamIdleTimeout"
          value: 15s

Terraform

현재 구성에 맞게 konnect_mesh_control_plane.my_meshcontrolplane.id와 konnect_mesh.my_mesh.name을 조정하세요. {: .text-sm}

resource "konnect_mesh_proxy_patch" "custom_template_1" {
  provider = konnect-beta
  type = "MeshProxyPatch"
  name = "custom-template-1"
  spec = {
    target_ref = {
      kind = "MeshGateway"
      name = "gateway"
    }
    default = {
      append_modifications = [
        {
          network_filter = {
            operation = "Patch"
            match = {
              name = "envoy.filters.network.http_connection_manager"
              origin = "gateway"
            }
            json_patches = [
              {
                op = "replace"
                path = "/streamIdleTimeout"
                value = "15s"
              }
            ]
          }
        }
      ]
    }
  }
  labels   = {
  "kuma.io/mesh" = konnect_mesh.my_mesh.name
  }
  cp_id    = konnect_mesh_control_plane.my_meshcontrolplane.id
  mesh     = konnect_mesh.my_mesh.name
}

더 알아보기 (Learn more)

이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.