<p>In <a href="https://github.com/behrangsa/hello-k8s/tree/stackoverflow" rel="nofollow noreferrer">this</a> project, let's say I set the value of <a href="https://github.com/behrangsa/hello-k8s/blob/stackoverflow/deployment/kustomize/base/virtualservice.yaml#L7" rel="nofollow noreferrer">hosts</a> to <code>hello</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: hello-k8s
spec:
  hosts:
    - ???
  http:
    - name: hello-k8s
      match:
        - uri:
            prefix: /
      route:
        - destination:
            host: hello               # &lt;--------------
            port:
              number: 8080
</code></pre>
<p>After deploying the project to my local minikube:</p>
<ul>
<li>What domain name should I send my requests to? <code>hello.local</code>?</li>
</ul>
<pre class="lang-sh prettyprint-override"><code>$ curl what.should.be.here:8080
</code></pre>
<ul>
<li>Is there a way to find it out using <code>kubectl</code> and introspection?</li>
</ul>
<hr />
<p><em>Update 1:</em></p>
<p>I changed the host to <code>hello.local</code>.</p>
<p>Then I verified that <code>istio</code> is enabled in <code>minikube</code>:</p>
<pre><code>➜ minikube addons list
|-----------------------------|----------|--------------|
|         ADDON NAME          | PROFILE  |    STATUS    |
|-----------------------------|----------|--------------|
| ambassador                  | minikube | disabled     |
| csi-hostpath-driver         | minikube | disabled     |
| dashboard                   | minikube | disabled     |
| default-storageclass        | minikube | enabled ✓    |
| efk                         | minikube | disabled     |
| freshpod                    | minikube | disabled     |
| gcp-auth                    | minikube | disabled     |
| gvisor                      | minikube | disabled     |
| helm-tiller                 | minikube | disabled     |
| ingress                     | minikube | disabled     |
| ingress-dns                 | minikube | disabled     |
| istio                       | minikube | enabled ✓    |
| istio-provisioner           | minikube | enabled ✓    |
| kubevirt                    | minikube | disabled     |
| logviewer                   | minikube | disabled     |
| metallb                     | minikube | disabled     |
| metrics-server              | minikube | disabled     |
| nvidia-driver-installer     | minikube | disabled     |
| nvidia-gpu-device-plugin    | minikube | disabled     |
| olm                         | minikube | disabled     |
| pod-security-policy         | minikube | disabled     |
| registry                    | minikube | disabled     |
| registry-aliases            | minikube | disabled     |
| registry-creds              | minikube | disabled     |
| storage-provisioner         | minikube | enabled ✓    |
| storage-provisioner-gluster | minikube | disabled     |
| volumesnapshots             | minikube | disabled     |
|-----------------------------|----------|--------------|
</code></pre>
<p>I deployed the app and verified everything is working:</p>
<pre><code>➜ kubectl apply -k base/
service/hello-k8s unchanged
deployment.apps/hello-k8s unchanged
virtualservice.networking.istio.io/hello-k8s configured

➜ kubectl get deployments/hello-k8s
NAME        READY   UP-TO-DATE   AVAILABLE   AGE
hello-k8s   1/1     1            1           20h

➜ kubectl get pods
NAME                         READY   STATUS    RESTARTS   AGE
hello-k8s-6d9cc7d655-plzs8   1/1     Running   0          20h

➜ kubectl get service/hello-k8s
NAME        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
hello-k8s   ClusterIP   10.98.144.226   &lt;none&gt;        8080/TCP   21h

➜ kubectl get virtualservice/hello-k8s
NAME        GATEWAYS   HOSTS             AGE
hello-k8s              [&quot;hello.local&quot;]   20h

➜ kubectl get pods -n istio-system
NAME                                    READY   STATUS    RESTARTS   AGE
istio-ingressgateway-8577c95547-6c9sk   1/1     Running   0          21h
istiod-6ccd677dc7-7cvr2                 1/1     Running   0          21h
prometheus-7767dfd55-x2pv6              2/2     Running   0          21h
</code></pre>
<p>Not sure why I have to do this, but apparently it should be done:</p>
<pre><code>➜ kubectl label namespace default istio-injection=enabled --overwrite
namespace/default labeled

➜ kubectl get namespace -L istio-injection
NAME              STATUS   AGE   ISTIO-INJECTION
default           Active   21h   enabled
istio-operator    Active   21h
istio-system      Active   21h   disabled
kube-node-lease   Active   21h
kube-public       Active   21h
kube-system       Active   21h
playground        Active   21h
</code></pre>
<p>I inspected the ip of <code>minikube</code> and added an entry to /etc/hosts for <code>hello.local</code>:</p>
<pre><code>➜  minikube ip
192.168.49.2

➜ tail -n 3  /etc/hosts

# Minikube
192.168.49.2    hello.local
</code></pre>
<p>Then I queried the port of <code>istio-ingressgateway</code> according to <a href="https://shekhargulati.com/2019/03/05/istio-minikube-tutorial-deploying-a-hello-world-example-application-with-istio-in-kubernetes/" rel="nofollow noreferrer">this blog post</a>:</p>
<pre><code>➜ kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name==&quot;http2&quot;)].nodePort}'
30616
</code></pre>
<p>Finally I sent a request to <code>hello.local:30616</code>, but the requests are not arriving at my app:</p>
<pre><code>➜ curl -iv hello.local:30616/hello
*   Trying 192.168.49.2:30616...
* TCP_NODELAY set
* Connected to hello.local (192.168.49.2) port 30616 (#0)
&gt; GET /hello HTTP/1.1
&gt; Host: hello.local:30616
&gt; User-Agent: curl/7.68.0
&gt; Accept: */*
&gt;
* Mark bundle as not supporting multiuse
&lt; HTTP/1.1 404 Not Found
HTTP/1.1 404 Not Found
&lt; date: Thu, 25 Feb 2021 14:51:18 GMT
date: Thu, 25 Feb 2021 14:51:18 GMT
&lt; server: istio-envoy
server: istio-envoy
&lt; content-length: 0
content-length: 0

&lt;
* Connection #0 to host hello.local left intact
</code></pre>

Behrang Saeedzadeh
<p><strong>What domain name should I send my requests to?  <code>hello.local</code>?</strong></p>
<p>The answer would be that you can use whatever the domain you want but you will be required to add this domain in <code>/etc/hosts</code>. Then <code>/etc/hosts</code> domain will be the ip address of the <a href="https://istio.io/latest/docs/tasks/traffic-management/ingress/ingress-control/#determining-the-ingress-ip-and-ports" rel="nofollow noreferrer">istio gateway loadbalancer</a>.
Thanks to it you will be able to use that domain instead of the ingress gateway ip</p>
<p><strong>Moving on there are couple of things about hosts/host in Virtual Service to consider:</strong></p>
<p>If you set virtual service <code>hosts</code> value to just <code>hello</code> then as per documentation Istio will interpret the short name based on the namespace of the rule, not the service. A rule in the <code>default</code> namespace with host <code>hello</code> will be interpreted as <code>hello.default.svc.cluster.local</code>.</p>
<p>You can also reference services along domains in hosts.</p>
<p><strong>So to avoid potential misconfigurations, it is recommended to always use fully qualified domain names over short names.</strong></p>
<p>Now coming next to <code>destination.host</code>:</p>
<blockquote>
<p>The name of a service from the service registry. Service names are
looked up from the platform’s service registry (e.g., Kubernetes
services, Consul services, etc.) and from the hosts declared by
<a href="https://istio.io/latest/docs/reference/config/networking/service-entry/#ServiceEntry" rel="nofollow noreferrer">ServiceEntry</a>.
Traffic forwarded to destinations that are not found in either of the
two, will be dropped.</p>
</blockquote>
<p>Here's also a <a href="https://medium.com/@emirmujic/istio-and-metallb-on-minikube-242281b1134b" rel="nofollow noreferrer">good exmpale</a> how to configure metallb as loadbalancer and istio in minikube. Having metallb will give your service automatically configure as loadbalancer.</p>
<hr />
<p>After further checking into your case I figure that problem might be related to your <a href="https://istio.io/latest/docs/reference/config/networking/gateway/." rel="nofollow noreferrer">gateway</a> not being used at all:</p>
<pre class="lang-sh prettyprint-override"><code>➜ kubectl get virtualservice/hello-k8s
NAME        GATEWAYS   HOSTS             AGE
hello-k8s              [&quot;hello.local&quot;]   20h ## Gateway describes a load balancer operating at the edge of the mesh receiving incoming or outgoing HTTP/TCP connections.
</code></pre>
<blockquote>
<p>&quot;Gateway describes a load balancer operating at the edge of the mesh
receiving incoming or outgoing HTTP/TCP connections. Using Istio
Gateway configuration you can bind VirtualService via
virtualservice.spec.gateways with specific gateways (allowing external
traffic or internal traffic inside istio service mesh) &quot;The reserved
word mesh is used to imply all the sidecars in the mesh. When this
field is omitted, the default gateway (mesh) will be used&quot;
<a href="https://istio.io/latest/docs/reference/config/networking/virtual-service/#VirtualService" rel="nofollow noreferrer">https://istio.io/latest/docs/reference/config/networking/virtual-service/#VirtualService</a></p>
</blockquote>
<p>Make sure you configure <code>Gateway</code> and <code>VirtualService</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: my-gateway
spec:
  selector:
    istio: ingressgateway  ### this should be verified with istio ingress gateway pod labels
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - &quot;*&quot;   ### for specific hosts it can be f.e. hello.local
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: hello-k8s
spec:
  hosts:
    - hello.local
  gateways:
  - my-gateway
  http:
    - match:
        - uri:
            prefix: /
      route:
        - destination:
            host: hello-k8s.default.svc.cluster.local 
            port:
              number: 8080
</code></pre>
