apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: tdb-oauth
  namespace: sta-tdb-oauth
spec:
  hosts:
    - <<SITES>>
  gateways:
    - tdb-oauth-gateway
  http:
    - match:
        - scheme:
            exact: http
      redirect:
        scheme: https
        redirectCode: 302
    - match:
        - uri:
            prefix: /.well-known/acme-challenge
      route:
        - destination:
            host: cert-manager-webhook.cert-manager.svc.cluster.local
            port:
              number: 443
    - route:
        - destination:
            host: sta-tdb-oauth
            port:
              number: 8080
