使用Istio时如何通过IP访问Pod?Spring Boot Admin调用问题
Istio环境下Spring Boot Admin无法访问Pod actuator端点的问题
我需要使用Spring Boot Admin管理K8s中的Pod,但遇到了无法调用Pod actuator端点的问题,推测是Istio阻止了直接通过Pod IP访问服务的请求,以下是我的测试验证:
测试1:通过Pod IP访问
执行命令后返回503错误:# curl -I http://10.40.133.41 HTTP/1.1 503 Service Unavailable content-length: 95 content-type: text/plain date: Thu, 03 Nov 2022 03:10:54 GMT server: envoy测试2:通过服务名访问
同样的服务,用服务名访问则正常返回200:# curl -I http://httpbin HTTP/1.1 200 OK server: envoy date: Thu, 03 Nov 2022 03:09:02 GMT content-type: text/html; charset=utf-8 content-length: 9593 access-control-allow-origin: * access-control-allow-credentials: true x-envoy-upstream-service-time: 3
我尝试过在请求中添加服务名作为Host请求头,但Istio似乎只会通过服务名查找对应Pod,而忽略指定的IP——比如用一个错误的IP但指定正确Host头时,依然返回成功:
# curl -I -H "Host: httpbin" http://100.40.133.41 HTTP/1.1 200 OK server: envoy date: Thu, 03 Nov 2022 03:39:00 GMT content-type: text/html; charset=utf-8 content-length: 9593 access-control-allow-origin: * access-control-allow-credentials: true x-envoy-upstream-service-time: 2
请问有人知道:
- 如何在Istio中允许Pod通过直接IP访问其他Pod?
- Istio环境下使用Spring Boot Admin还有哪些可行的解决方案?
内容的提问来源于stack exchange,提问作者kai
相关产品推荐
相关产品推荐

