apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: cluster-gateway
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"

---

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: demo-vs
spec:
  hosts:
  - "demo.example.com"
  gateways:
  - cluster-gateway
  http:
  - match:
    route:
    - destination:
        host: demo-service
        subset: v1
        port:
          number: 8080

---

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: demo-destinationrule
spec:
  host: demo-service
  subsets:
  - name: v1
    labels:
      version: v1
