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

     1  apiVersion: gateway.networking.k8s.io/v1beta1
     2  kind: Gateway
     3  metadata:
     4    name: gateway
     5    namespace: istio-system
     6  spec:
     7    addresses:
     8    - value: istio-ingressgateway
     9      type: Hostname
    10    gatewayClassName: istio
    11    listeners:
    12    - name: simple
    13      hostname: "*.domain.example"
    14      port: 80
    15      protocol: HTTP
    16      allowedRoutes:
    17        namespaces:
    18          from: All
    19  ---
    20  apiVersion: gateway.networking.k8s.io/v1beta1
    21  kind: ReferenceGrant
    22  metadata:
    23    name: allow-service
    24    namespace: service
    25  spec:
    26    from:
    27    - group: gateway.networking.k8s.io
    28      kind: HTTPRoute
    29      namespace: istio-system
    30    to:
    31    - group: ""
    32      kind: Service
    33      name: my-svc
    34  ---
    35  apiVersion: gateway.networking.k8s.io/v1beta1
    36  kind: HTTPRoute
    37  metadata:
    38    name: http
    39    namespace: istio-system
    40  spec:
    41    parentRefs:
    42    - name: gateway
    43      namespace: istio-system
    44    hostnames: ["simple.domain.example"]
    45    rules:
    46    - backendRefs:
    47      - name: my-svc
    48        namespace: service
    49        port: 80
    50  ---
    51  apiVersion: gateway.networking.k8s.io/v1beta1
    52  kind: HTTPRoute
    53  metadata:
    54    name: backend-not-allowed
    55    namespace: istio-system
    56  spec:
    57    parentRefs:
    58    - name: gateway
    59      namespace: istio-system
    60    hostnames: ["simple2.domain.example"]
    61    rules:
    62    - backendRefs:
    63      - name: my-svc
    64        namespace: service
    65        port: 80
    66        weight: 1
    67      - name: httpbin
    68        namespace: default
    69        port: 80
    70        weight: 1