instana / robot-shop

Sample microservices application for playing with
http://instana.com/
Apache License 2.0
866 stars 3.69k forks source link

Cannot access the web UI when deploying in k8s #145

Closed yinfangchen closed 1 year ago

yinfangchen commented 1 year ago

I am using helm to deploy robot-shop in k8s: https://github.com/instana/robot-shop/blob/master/K8s/helm/README.md#helm-v3x

However, I cannot access to the web UI via 192.168.49.2:31241

$ minikube ip
192.168.49.2
$ kubectl get svc web -n robot-shop
NAME   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
web    LoadBalancer   10.104.90.129   <pending>     8080:31241/TCP   3m44s

In the web service pod, it continuously generates logs like these:

│ 2023-10-20 22:47:19, 19 [lis] Error: lookup requests for all agent host candidates failed                                                                 │
│ 2023-10-20 22:47:19, 29 [lis] Error: lookup requests for all agent host candidates failed                                                                 │
│ 2023-10-20 22:47:20, 18 [lis] Error: lookup requests for all agent host candidates failed

For the dispatch pod, I got:

2023/10/20 23:41:21 instana: INFO: failed to send a request to http://192.168.49.2:42699/: Get "http://192.168.49.2:42699/": dial tcp 192.16 
│ 2023/10/20 23:41:21 instana: INFO: failed to send a request to http://10.244.0.1:42699/: Get "http://10.244.0.1:42699/": dial tcp 10.244.0.1 
│ 2023/10/20 23:41:21 instana: ERROR: cannot connect to the agent through localhost or default gateway, scheduling retry                      
│ 2023/10/20 23:41:51 instana: INFO: failed to send a request to http://192.168.49.2:42699/: Get "http://192.168.49.2:42699/": dial tcp 192.16
│ 2023/10/20 23:41:51 instana: INFO: failed to send a request to http://10.244.0.1:42699/: Get "http://10.244.0.1:42699/": dial tcp 10.244.0.1 
│ 2023/10/20 23:41:51 instana: ERROR: cannot connect to the agent through localhost or default gateway, scheduling retry                      
│ 2023/10/20 23:41:56 instana: ERROR: Failed sending profiles, backing off next sending                                                        
│ 2023/10/20 23:41:56 instana: ERROR: sender not ready 

I can start robot-shop when running it locally. https://github.com/instana/robot-shop#run-locally

yinfangchen commented 1 year ago

I tried to do the nslookup in the web pod, and it was able to resolve all the other pods' hostnames:

 nslookup 10.244.0.6               
6.0.244.10.in-addr.arpa name = 10-244-0-6.user.robot-shop.svc.cluster.local.

# nslookup 10.244.0.12
12.0.244.10.in-addr.arpa    name = 10-244-0-12.shipping.robot-shop.svc.cluster.local.

# nslookup 10.244.0.14
14.0.244.10.in-addr.arpa    name = redis-0.redis.robot-shop.svc.cluster.local.

# nslookup 10.244.0.13
13.0.244.10.in-addr.arpa    name = 10-244-0-13.ratings.robot-shop.svc.cluster.local.

# nslookup 10.244.0.10
10.0.244.10.in-addr.arpa    name = 10-244-0-10.rabbitmq.robot-shop.svc.cluster.local.

# nslookup 10.244.0.3
3.0.244.10.in-addr.arpa name = 10-244-0-3.payment.robot-shop.svc.cluster.local.

# nslookup 10.244.0.5
5.0.244.10.in-addr.arpa name = 10-244-0-5.mysql.robot-shop.svc.cluster.local.

# nslookup 10.244.0.9
9.0.244.10.in-addr.arpa name = 10-244-0-9.mongodb.robot-shop.svc.cluster.local.

# nslookup 10.244.0.11
11.0.244.10.in-addr.arpa    name = 10-244-0-11.dispatch.robot-shop.svc.cluster.local.

# nslookup 10.244.0.8
8.0.244.10.in-addr.arpa name = 10-244-0-8.catalogue.robot-shop.svc.cluster.local.

# nslookup 10.244.0.4
4.0.244.10.in-addr.arpa name = 10-244-0-4.cart.robot-shop.svc.cluster.local.
yinfangchen commented 1 year ago

OK, I made it work by using minikube service web -n robot-shop.