Go 无动力pod http请求

Go 无动力pod http请求,go,kubernetes,knative,Go,Kubernetes,Knative,当我请求此已启动的服务器时: 我得到了正确的回答: { "args": {}, "headers": { "Accept-Encoding": "gzip", "Connection": "close", "Host": "httpbin.org", "User-Agent": "Go-http-client/1.1" }, "origin": "", "url": "https://httpbin.org/get" } 但当我向

当我请求此已启动的服务器时:

我得到了正确的回答:

{
  "args": {}, 
  "headers": {
    "Accept-Encoding": "gzip", 
    "Connection": "close", 
    "Host": "httpbin.org", 
    "User-Agent": "Go-http-client/1.1"
  }, 
  "origin": "", 
  "url": "https://httpbin.org/get"
}
但当我向minikube上的服务器发出请求时,该服务器是以这种方式创建的:

我得到一个错误:

ERROR: Get https://httpbin.org/get: EOF<nil>
错误:获取https://httpbin.org/get: EOF
如何从kubernetes pod发出http请求?

默认情况下,Knative uses和Istio不允许向外部主机(如httpbin.org)发送出站流量。这就是你的请求失败的原因

下面了解如何配置Knative(以便正确配置Istio)以进行出站连接。或者,您可以通过添加出口策略直接配置Istio:

默认情况下,Istio不允许到外部主机(如httpbin.org)的出站流量。这就是你的请求失败的原因

下面了解如何配置Knative(以便正确配置Istio)以进行出站连接。或者,您可以通过添加出口策略直接配置Istio: