RouteTLSSDSFilter 참조

RouteTLSSDSFilter 참조 (Kubernetes) (RouteTLSSDSFilter reference (Kubernetes))

RouteTLSSDSFilter는 Kubernetes 전용 커스텀 리소스로, HTTPRoute 백엔드가 SDS로 TLS 인증서 선택을 재정의할 수 있게 해요. 특정 백엔드 서비스가 리스너 또는 게이트웨이 기본 SDS 인증서와 다른 인증서를 제시해야 할 때 사용해요.

출처: 문서

본문

RouteTLSSDSFilter는 Kubernetes 전용 커스텀 리소스로, HTTPRoute 백엔드가 SDS로 TLS 인증서 선택을 재정의할 수 있게 합니다. 특정 백엔드 서비스가 리스너 또는 게이트웨이 기본 SDS 인증서와 다른 인증서를 제시해야 할 때 사용합니다.

구성 모델 (Configuration model)

RouteTLSSDSFilter는 다음과 같은 형태를 갖습니다:

필드 참조 (Field reference)

spec.sds.certResource

이 백엔드에 요청할 SDS 인증서 리소스 이름을 정의합니다.

  • 필수: 예
  • 유형: string

spec.sds.clusterName

certResource를 가져오는 데 사용되는 SDS 클러스터를 정의합니다.

  • 필수: 아니요 (상속된 경우)
  • 유형: string
  • 상속: 생략하면 정확히 하나의 유효한 클러스터를 해석할 수 있는 경우 Kubernetes가 리스너/게이트웨이 SDS 기본값에서 상속할 수 있습니다.

필터 연결 방법 (How to attach the filter)

HTTPRoute.rules[].backendRefs[].filters[]에 ExtensionRef를 사용하여 RouteTLSSDSFilter를 연결합니다:

검증 동작 (Validation behavior)

  • spec.sds.certResource가 설정되어 있어야 합니다.
  • spec.sds.clusterName을 생략하면 상속이 정확히 하나의 SDS 클러스터로 해석되어야 합니다.
  • 상속이 없거나 모호하면 라우트/필터가 거부됩니다.
  • 규칙 수준 배치(HTTPRoute.rules[].filters[])는 이 필터 유형에 유효하지 않습니다.

예시: 명시적 clusterName 및 certResource (Example: explicit clusterName and certResource)

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: api-route-override
  namespace: default
spec:
  parentRefs:
  - name: sds-gateway
    sectionName: https
  hostnames:
  - b.example.test
  rules:
  - backendRefs:
    - name: svc-b
      port: 5678
      filters:
      - type: ExtensionRef
        extensionRef:
          group: consul.hashicorp.com
          kind: RouteTLSSDSFilter
          name: route-sds-override-http
---
apiVersion: consul.hashicorp.com/v1alpha1
kind: RouteTLSSDSFilter
metadata:
  name: route-sds-override-http
  namespace: default
spec:
  sds:
    clusterName: sds-cluster-2
    certResource: foo.example.com

예시: 상속된 clusterName (Example: inherited clusterName)

이 예제에서 필터는 certResource만 설정합니다. SDS clusterName은 게이트웨이/리스너 기본값에서 상속됩니다.

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: sds-gateway
  namespace: default
  annotations:
    api-gateway.consul.hashicorp.com/tls_sds_cluster_name: sds-cluster
    api-gateway.consul.hashicorp.com/tls_sds_cert_resource: wildcard.ingress.consul
spec:
  gatewayClassName: consul
  listeners:
  - name: https
    protocol: HTTPS
    port: 8443
    hostname: a.example.test
    tls:
      mode: Terminate
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: api-route-inherit
  namespace: default
spec:
  parentRefs:
  - name: sds-gateway
    sectionName: https
  hostnames:
  - c.example.test
  rules:
  - backendRefs:
    - name: svc-c
      port: 5678
      filters:
      - type: ExtensionRef
        extensionRef:
          group: consul.hashicorp.com
          kind: RouteTLSSDSFilter
          name: route-sds-inherit
---
apiVersion: consul.hashicorp.com/v1alpha1
kind: RouteTLSSDSFilter
metadata:
  name: route-sds-inherit
  namespace: default
spec:
  sds:
    certResource: c.example.test

더 알아보기 (Learn more)