直接调用 Kubernetes pod

Make a direct call to Kubernetes pod

我在 Kubernetes 集群中有几个 pods 运行。 如何在不调用 LoadBalancer 服务的情况下对特定 Pod 进行 http 调用?

...make http call to a specific Pod, without calling LoadBalancer service?

有几种方法,尝试 kubectl port-forward <pod name> 8080:80,然后打开另一个终端,您现在可以执行 curl localhost:8080,这会将您的请求转发到 pod。更多详情 here.