istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pilot/pkg/config/kube/gateway/testdata/weighted.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: http 20 hostname: "*.domain.example" 21 port: 80 22 protocol: HTTP 23 allowedRoutes: 24 namespaces: 25 from: All 26 - name: tcp 27 port: 34000 28 protocol: TCP 29 allowedRoutes: 30 namespaces: 31 from: All 32 --- 33 apiVersion: gateway.networking.k8s.io/v1beta1 34 kind: HTTPRoute 35 metadata: 36 name: http 37 namespace: default 38 spec: 39 parentRefs: 40 - name: gateway 41 namespace: istio-system 42 hostnames: ["first.domain.example"] 43 rules: 44 - matches: 45 - path: 46 type: PathPrefix 47 value: /get 48 backendRefs: 49 - name: httpbin 50 port: 80 51 weight: 2 52 - name: httpbin-other 53 port: 8080 54 weight: 3 55 - name: httpbin-zero 56 port: 8080 57 weight: 0 58 - matches: 59 - path: 60 type: PathPrefix 61 value: /weighted-100 62 backendRefs: 63 - filters: 64 - requestHeaderModifier: 65 add: 66 - name: foo 67 value: bar 68 type: RequestHeaderModifier 69 - responseHeaderModifier: 70 add: 71 - name: response 72 value: header 73 type: ResponseHeaderModifier 74 port: 8000 75 name: foo-svc 76 weight: 100 77 --- 78 apiVersion: gateway.networking.k8s.io/v1alpha2 79 kind: TCPRoute 80 metadata: 81 name: tcp 82 namespace: default 83 spec: 84 parentRefs: 85 - name: gateway 86 namespace: istio-system 87 rules: 88 - backendRefs: 89 - name: httpbin 90 port: 9090 91 weight: 1 92 - name: httpbin-alt 93 port: 9090 94 weight: 2