Open brolinuk opened 3 years ago
Your issue with accessing the BookInfo application via the Istio Ingress Gateway could be due to misconfiguration or port conflicts, especially considering the use of WSL2 and Docker Desktop. It's essential to ensure correct port forwarding and address potential port conflicts on Windows.
Accessing services in a Kubernetes cluster running in WSL2 via Istio's Ingress Gateway involves several components: Istio setup, Kubernetes service exposure, and network port forwarding. The connection refusal and 404 errors indicate a possible misconfiguration or a networking issue.
Istio Ingress Gateway Exposure:
Verifying Gateway and Virtual Service:
WSL2 Networking Considerations:
localhost
on Windows and WSL2 might not refer to the same environment. Use the WSL2 IP address (found in /etc/resolv.conf
) to test services running inside WSL2.Windows Port Conflicts:
netstat
output suggests), it could conflict with the port forwarding from WSL2.Testing Access:
localhost
or 127.0.0.1
.curl
, it might indicate a port forwarding issue or a misconfiguration in the Istio Ingress setup.localhost
, use the IP address from /etc/resolv.conf
in WSL2 to access your service.kubectl logs -n istio-system <istio-ingressgateway-pod-name>
).By addressing these areas, you should be able to identify and resolve the issue with accessing the BookInfo application.
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
1) Deployed all services from bookinfo example and all up running, I can curl productpage from other service using kubectl exec 2) Deployed bookinfo-gateway using the file from the example without any change under the default namespace
Name: bookinfo-gateway Namespace: default Labels:
Annotations:
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:
3) 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 enter image description here
4) following Determining the ingress IP and ports section in the instruction https://istio.io/latest/docs/setup/getting-started/ My INGRESS_HOST=127.0.0.1 and INGRESS_PORT is 80
5) curl -v -s http://127.0.0.1:80/productpage | grep -o ".*"
7) 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
8) 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
netstat -aon | findstr :80 TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4
tasklist /svc /FI "PID eq 4"
Image Name PID Services ========================= ======== ============================================ System 4 N/A I am wondering whether this is what causes the difference in point 7? As windows is running on another http server on port 80?
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. Many thanks