Finding the Ingress gateway IP address

Let's find out how to find the gateway IP addresses so that virtual services can be created later to direct traffic from outside the application to the required microservice. After doing this, we can manage the traffic based on rules that can be defined outside the application. Let's get started:

  1. To find out the ingress gateway IP address, enter the following command:
$ kubectl -n istio-system get svc istio-ingressgateway
NAME TYPE CLUSTER-IP EXTERNAL-IP ---
istio-ingressgateway LoadBalancer 10.109.15.152 192.168.142.249 ---

--- PORT(S) AGE
--- 15020:30826/TCP,80:31380/TCP,443:31390/TCP,31400:31400/TCP,
15029:31618/TCP,15030:31759/TCP,15031:31344/TCP,
15032:30143/TCP,15443:32383/TCP 43m

The external IP address that's assigned to the Istio ingress gateway, as per the preceding output, is 192.168.142.249. This might be different in your case. 

  1. Save the external IP of the ingress gateway in an environment variable that you can use later:
$ export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress..ip}') ; echo $INGRESS_HOST
192.168.142.249

In reality, the external IP address will be mapped to a name using a DNS server.

  1. Now, let's try to access the BookInfo application, http://192.168.142.249You will notice that it can't find the page:
$ curl -v http://$INGRESS_HOST/productpage
* About to connect() to 192.168.142.249 port 80 (#0)
...
< HTTP/1.1 404 Not Found
...

We need to map the Kubernetes productpage service to the gateway, and we will do that by creating an Istio primitive called Virtual Service

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.233.41