i had setup the kubernetes Ingress with ingress-nginx with the following code, in my local machine,
which will direct the traffic to the backend service in kubernetes
after the setup is complete. i try to browse to the platform service web api which is hosted in the backend server.
http://acme.com/api/platforms/ but the error comes up immediately, which indicated that
- The directory or file specified does not exist on the Web server.
As we manipulate the kubernetes in the local environment, we can check what process is using the port 80
C:\code\dotnet-microservices\k8s>netstat -ano | findstr ":80" | findstr "LISTENING"
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:8081 0.0.0.0:0 LISTENING 4
TCP [::]:80 [::]:0 LISTENING 4
TCP [::]:8081 [::]:0 LISTENING 4
the PID 4 represnet that the port 80 had been assigned to IIS local host. we should stop the World Wide Web Publishing Service, in order to release the port 80 for Kubernetes services.
after I stop the World Wide Web Publishing Service, the we can see that port 80 had been assigned to different processes.
C:\code\dotnet-microservices\k8s>netstat -ano | findstr ":80" | findstr "LISTENING"
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 3440
TCP [::]:80 [::]:0 LISTENING 3440
TCP [::1]:80 [::]:0 LISTENING 16096
Now we should be able to access the web api host in the kubernetes.
[{"id":1,"name":"dotnet","cost":"free","publisher":"Microsoft"},{"id":2,"name":"SQL Server Express","cost":"free","publisher":"Microsoft"},{"id":3,"name":"Kubernetes","cost":"free","publisher":"Cloud Native Computer Foundation"}]
No comments:
Post a Comment