apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
  name: gatewayapi
  namespace: istio-system
  labels:
    app: gatewayapi
spec:
  gatewayClassName: istio
  listeners:
  - name: default
    hostname: "bookinfo-istio-system.apps.ocp4-kqe1.maistra.upshift.redhat.com"
    port: 80
    protocol: HTTP
    allowedRoutes:
      namespaces:
        from: All
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: httproute
  namespace: bookinfo
spec:
  parentRefs:
  - name: gatewayapi
    namespace: istio-ingress
  hostnames: ["bookinfo-istio-system.apps.ocp4-kqe1.maistra.upshift.redhat.com"]
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /get
    backendRefs:
    - name: httpbin
      port: 8000
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: httprouteweight
  namespace: bookinfo
spec:
  parentRefs:
  - name: gatewayapi
    namespace: istio-ingress
  hostnames: ["bookinfo-istio-system.apps.ocp4-kqe1.maistra.upshift.redhat.com"]
  rules:
  - matches:
    backendRefs:
    - name: httpbin
      weight: 100
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: httproutestatus
  namespace: bookinfo
spec:
  parentRefs:
  - name: gatewayapi
    namespace: istio-ingress
  hostnames: ["bookinfo-istio-system.apps.ocp4-kqe1.maistra.upshift.redhat.com"]
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /get
    backendRefs:
    - name: httpbin
      port: 8000
      filters:
      - requestRedirect:
          statusCode: 301
        type: "RequestRedirect"
