1.14.2.2. 하위 도메인 경로 생성

다음 예제에서는 Bookinfo 샘플 애플리케이션에 게이트웨이를 생성하여 하위 도메인 경로를 생성합니다.

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: gateway1
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - www.bookinfo.com
    - bookinfo.example.com

Gateway 리소스는 다음 OpenShift 경로를 생성합니다. 다음 명령을 사용하여 경로가 생성되었는지 확인할 수 있습니다. 이 예제에서 istio-system 은 Service Mesh Control Plane 프로젝트의 이름입니다.

$ oc -n istio-system get routes

예상 출력

NAME           HOST/PORT             PATH  SERVICES               PORT  TERMINATION   WILDCARD
gateway1-lvlfn bookinfo.example.com        istio-ingressgateway   <all>               None
gateway1-scqhv www.bookinfo.com            istio-ingressgateway   <all>               None

게이트웨이를 삭제하면 Red Hat OpenShift Service Mesh가 경로를 삭제합니다. 그러나 수동으로 생성한 경로는 Red Hat OpenShift Service Mesh에 의해 수정되지 않습니다.