1
  1. 我在 5 个 pod 中有 5 个微服务,并使用 NODE PORT 服务使用特定端口部署了每个服务。
  2. 我有一个 UI 应用程序作为另一个 pod 内的一项服务,该 pod 也使用节点端口服务公开。

由于我无法使用 pod IP 访问 UI 应用程序中的 url,因为 pod 生死存亡,因此部署为 nodeport 服务,我可以使用各自的节点端口无缝访问 UI 应用程序内的所有 5 个服务吗?

请告知-这种方法可靠吗?

4

1 回答 1

3
  1. Yes, you can connect to those Node port services seamlessly.

But remember, you may need higher network bandwidth card and connection (to master nodes) if you get too much traffic to these services.

Also if you have a few master nodes, you can try dedicated master node-ip and nodeport for a service.(If you have 5 master nodes, each service is accessed from one master node's IP etc. This is not mandatory, you can connect to each service using any masterIP:nodeport)

Highly recommend to use load-balancer service for this. If you have baremetal cluster try using MetalLB.

Edit : (after Nagappa LM`s comment)

  1. If its for QA, then no need to worry, but if they perform load test to all the services simultaneously could be a problematic.
  2. Your code change means, only your k8 - deployment is changed, not Kubernetes service. k8 service is where you define nodeport
于 2021-03-24T16:15:06.387 回答