[I’m currently using istio 1.3.1]
I have what I would think is a really simple situation. I want to forward HTTP requests using a hostname, but it doesn’t work.
If I use a wildcard for host, it works. If I use the hostname I want to use, it does not. I get no errors, just no routing. I am just trying to connect to an instance of Grafana for testing purposes. Here are my gw & vs yamls:
apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: grafana-gw spec: selector: istio: ingressgateway # use istio default ingress gateway servers: - port: number: 80 name: http protocol: HTTP hosts: - "grafana.localdomain" # - "*" --- apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: grafana-vs spec: hosts: #- "*" - grafana.default.svc.cluster.local # - "grafana.localdomain" gateways: - grafana-gw http: - match: - uri: prefix: / route: - destination: port: number: 8080 host: grafana-svc
As configured above, this does not work. If I change the two host specs to “*” it does, but now of course all HTTP requests are going to this service regardless of host, which I do not want.
What am I missing here? Oh, second question - sometimes in examples I see the URL hostname (grafana.localdomain) and sometimes it’s the service name within the cluster. Are both forms always usable? Is it one or the other? I haven’t been able to find any docs on the specifics of the host parameter.