istio.io/istio@v0.0.0-20240520182934-d79c90f27776/tests/testdata/config/rule-default-route.yaml (about)

     1  apiVersion: networking.istio.io/v1alpha3
     2  kind: ServiceEntry
     3  metadata:
     4    name: c
     5    namespace: testns
     6  spec:
     7     hosts:
     8     - c.foo
     9     ports:
    10     - number: 80
    11       name: http
    12       protocol: HTTP
    13     resolution: STATIC
    14     endpoints:
    15      - address: 127.0.0.1
    16        ports:
    17          http: 7072
    18  ---
    19  apiVersion: networking.istio.io/v1alpha3
    20  kind: VirtualService
    21  metadata:
    22    name: default-route-1
    23    namespace: testns
    24  spec:
    25    hosts:
    26      - c.foo
    27    gateways:
    28    #- mesh # doesnt work
    29    - my-gateway
    30    http:
    31      - match:
    32        - uri:
    33             prefix: /bar
    34        route:
    35        - destination:
    36            host: c.foo
    37          weight: 100
    38  ---
    39  apiVersion: networking.istio.io/v1alpha3
    40  kind: VirtualService
    41  metadata:
    42    name: default-route-2
    43    namespace: testns
    44  spec:
    45    hosts:
    46      - c.foo
    47    gateways:
    48    #- mesh
    49    - my-gateway
    50    http:
    51      - match:
    52        - uri:
    53             exact: /foo
    54        rewrite:
    55          uri: /bar
    56        route:
    57        - destination:
    58            host: c.foo
    59          weight: 100