istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pilot/pkg/config/kube/gateway/testdata/route-precedence.yaml (about)

     1  apiVersion: gateway.networking.k8s.io/v1beta1
     2  kind: GatewayClass
     3  metadata:
     4    name: istio
     5  spec:
     6    controllerName: istio.io/gateway-controller
     7  ---
     8  apiVersion: gateway.networking.k8s.io/v1beta1
     9  kind: Gateway
    10  metadata:
    11    name: gateway
    12    namespace: istio-system
    13  spec:
    14    addresses:
    15    - value: istio-ingressgateway
    16      type: Hostname
    17    gatewayClassName: istio
    18    listeners:
    19    - name: default
    20      hostname: "*.domain.example"
    21      port: 80
    22      protocol: HTTP
    23      allowedRoutes:
    24        namespaces:
    25          from: Selector
    26          selector:
    27            matchLabels:
    28              istio.io/test-name-part: allowed
    29  ---
    30  apiVersion: gateway.networking.k8s.io/v1beta1
    31  kind: HTTPRoute
    32  metadata:
    33    name: http
    34    namespace: allowed-1
    35  spec:
    36    parentRefs:
    37    - name: gateway
    38      namespace: istio-system
    39    - group: ""
    40      kind: Service
    41      name: a-example
    42    - group: ""
    43      kind: Service
    44      name: b-example
    45    hostnames: ["a.domain.example", "b.domain.example"]
    46    rules:
    47    - matches:
    48      - path:
    49          type: PathPrefix
    50          value: /foo
    51        headers:
    52        - name: my-header
    53          value: some-value
    54          type: Exact
    55      backendRefs:
    56      - name: svc1
    57        port: 80
    58    - matches:
    59      - path:
    60          type: RegularExpression
    61          value: /foo((\/).*)?
    62      backendRefs:
    63      - name: svc2
    64        port: 80
    65  ---
    66  apiVersion: gateway.networking.k8s.io/v1beta1
    67  kind: HTTPRoute
    68  metadata:
    69    name: http
    70    namespace: allowed-2
    71  spec:
    72    parentRefs:
    73    - name: gateway
    74      namespace: istio-system
    75    - group: ""
    76      kind: Service
    77      name: a-example
    78    hostnames: ["a.domain.example"]
    79    rules:
    80    - matches:
    81      - path:
    82          type: PathPrefix
    83          value: /foo/bar
    84      - path:
    85          type: PathPrefix
    86          value: /bar
    87      backendRefs:
    88      - name: svc2
    89        port: 80
    90    - matches:
    91      - path:
    92          type: Exact
    93          value: /baz
    94        headers:
    95        - name: my-header
    96          value: some-value
    97          type: Exact
    98        queryParams:
    99        - name: my-param
   100          value: some-value
   101          type: RegularExpression
   102      backendRefs:
   103      - name: svc2
   104        port: 80
   105    - matches:
   106      - path:
   107          type: PathPrefix
   108          value: /
   109      backendRefs:
   110      - name: svc3
   111        port: 80
   112    - matches:
   113      - method: PATCH
   114        path:
   115          type: PathPrefix
   116          value: /
   117      backendRefs:
   118      - name: svc2
   119        port: 80
   120  ---
   121  apiVersion: gateway.networking.k8s.io/v1beta1
   122  kind: HTTPRoute
   123  metadata:
   124    name: http
   125    namespace: default
   126  spec:
   127    parentRefs:
   128    - name: gateway
   129      namespace: istio-system
   130    hostnames: ["a.domain.example", "b.domain.example"]
   131    rules:
   132    - matches:
   133      - path:
   134          type: PathPrefix
   135          value: /abc
   136        headers:
   137        - name: my-header
   138          value: some-value
   139          type: Exact
   140      backendRefs:
   141      - name: svc4
   142        port: 80
   143  ---