<p>I am trying to run the bookinfo example on my local with wsl2 and docker desk. I am having issues when trying to access the productpage service via the gateway as I got the connection refused. I am not sure whether I missed anything. Here is what I have done after googled a lot on the internet</p>
<ol>
<li>Deployed all services from bookinfo example and all up running, I can curl productpage from other service using kubectl exec</li>
<li>Deployed bookinfo-gateway using the file from the example without any change under the default namespace</li>
</ol>
<pre><code>Name:         bookinfo-gateway
Namespace:    default
Labels:       &lt;none&gt;
Annotations:  &lt;none&gt;
API Version:  networking.istio.io/v1beta1
Kind:         Gateway
Metadata:
  Creation Timestamp:  2021-06-06T20:47:18Z
  Generation:          1
  Managed Fields:
    API Version:  networking.istio.io/v1alpha3
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
      f:spec:
        .:
        f:selector:
          .:
          f:istio:
        f:servers:
    Manager:         kubectl-client-side-apply
    Operation:       Update
    Time:            2021-06-06T20:47:18Z
  Resource Version:  2053564
  Self Link:         /apis/networking.istio.io/v1beta1/namespaces/default/gateways/bookinfo-gateway
  UID:               aa390a1d-2e34-4599-a1ec-50ad7aa9bdc6
Spec:
  Selector:
    Istio:  ingressgateway
  Servers:
    Hosts:
      *
    Port:
      Name:      http
      Number:    80
      Protocol:  HTTP
Events:          &lt;none&gt;
</code></pre>
<ol start="3">
<li><p>The istio-ingressgateway can expose to the outside via localhost (not sure how this can be configured as it is deployed during istio installation) on 80, which I as understand will be used by bookinfo-gateway
kubectl get svc istio-ingressgateway -n istio-system
<a href="https://i.stack.imgur.com/8eKH6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8eKH6.png" alt="enter image description here" /></a></p>
</li>
<li><p>following Determining the ingress IP and ports section in <a href="https://istio.io/latest/docs/setup/getting-started/" rel="nofollow noreferrer">the instruction</a>.</p>
</li>
</ol>
<p>My  INGRESS_HOST=127.0.0.1 and INGRESS_PORT is 80</p>
<ol start="5">
<li>curl -v -s <a href="http://127.0.0.1:80/productpage" rel="nofollow noreferrer">http://127.0.0.1:80/productpage</a> | grep -o &quot;.*&quot;</li>
</ol>
<pre><code>*   Trying 127.0.0.1:80...
* TCP_NODELAY set
* connect to 127.0.0.1 port 80 failed: Connection refused
* Failed to connect to 127.0.0.1 port 80: Connection refused
* Closing connection 0
</code></pre>
<ol start="6">
<li><p>trying this <a href="http://127.0.0.1/productpage" rel="nofollow noreferrer">http://127.0.0.1/productpage</a> on browser, return 404. Does this 404 mean the gateway is kind of up but virtual service is not working??</p>
</li>
<li><p>further question if it is relevant. I am a bit confusing how wsl2 works now. It looks like localhost on windows browser and wsl2 terminal are not the same thing, though I know there is kind of forwarding from windows to wsl2 server (which I can get its IP from /etc/resolv.conf). if it is the same, why one return connection refused and the other return 404</p>
</li>
<li><p>On windows I have tried to disable IIS or anything running on port 80 (net stop http). Somehow, I still can see something listen to port 80</p>
</li>
</ol>
<pre><code>netstat -aon | findstr :80
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       4


tasklist /svc /FI &quot;PID eq 4&quot;

Image Name                     PID Services
========================= ======== ============================================
System                           4 N/A
</code></pre>
<p>I am wondering whether this is what causes the difference in point 7? As windows is running on another http server on port 80?</p>
<p>I know this a lot of questions asked. I believe many of us that new to istio and wsl2 may have similar questions. Hopefully, this helps others as well. Please advise.</p>

user1619397
<p>I managed to get this working: This is what I did.
Shell into the distro (mine was Ubuntu 20.04 LTS)</p>
<p>Run:</p>
<pre><code>    sudo apt-get -y install socat
    sudo apt update
    sudo apt upgrade
    exit
</code></pre>
<p>The above will add socat (which I was getting errors with when looking at the istio logs - connection refused) and update the distro to the latest updates (and upgrade them)</p>
<p>Now you have to run a port-forward to be able to host localhost: to hit the istio gateway with:</p>
<pre><code>    kubectl port-forward svc/istio-ingressgateway 8080:80 -n istio-system
</code></pre>
<p>If you are already using 8080, just remove it from the command, just use :80 and the port forward will select a free port.</p>
<p>Now go to</p>
<pre><code>    http://localhost:8080/productpage
</code></pre>
<p>You should hit the page and the port-forward should output</p>
<pre><code>    Handling connection for 8080
</code></pre>
<p>Hope that helps...
Good thing is now I don't have to use Hyper-V or another cluster installer like minikube/microk8s and use the built-in kubernetes in docker desktop and... my laptop doesn't seem under load for what I'm doing too.</p>
