apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: gerrit-gerrit-http-virtual-service
  namespace: gerrit
spec:
  hosts:
  - example.com
  gateways:
  - gerrit/gerrit-istio-gateway
  http:
  - name: receiver-receiver
    match:
    - uri:
        prefix: "/a/projects/"
    - uri:
        regex: "^/(.*)/git-receive-pack$"
    - uri:
        regex: "^/(.*)/info/refs$"
      queryParams:
        service:
          exact: git-receive-pack
    route:
    - destination:
        port:
          number: 48081
        host: receiver.gerrit.svc.cluster.local
  - name: gerrit-replica-replica
    route:
    - destination:
        port:
          number: 48080
        host: replica.gerrit.svc.cluster.local
  tcp:
  - match:
    - port: 49419
    route:
    - destination:
        port:
          number: 49419
        host: replica.gerrit.svc.cluster.local
