[英]Kubernetes on GKE: bind load balancer to specific ip
In gke one can define a load balancer and it will bind to the public ip of one of the node. 在gke中,可以定义一个负载均衡器,它将绑定到该节点之一的公共ip。 How can I guaranty the service is always bound to the same public ip to not have to re configure external dns?
如何保证服务始终绑定到同一公共IP,而不必重新配置外部DNS?
Try setting the ClusterIP field when defining your service. 定义服务时,请尝试设置ClusterIP字段。 The documentation for the field says "If specified, it will be allocated to the service if it is unused or else creation of the service will fail" so this should allow you to bind your service to a specific IP address (presuming that you are allowed to use that address).
该字段的文档显示“如果指定,则如果未使用它将分配给服务,否则服务创建将失败”,因此这应该允许您将服务绑定到特定的IP地址(假定允许使用该地址)。
I don't think the LoadBalancer should be exposed through the IP of your pods, but instead get its own IP. 我不认为应该通过吊舱的IP来显示LoadBalancer,而应该使用自己的IP。
Use the Google cloud dashboard. 使用Google云端信息中心。 Navigate to Networking › External IP addresses.
导航到网络›外部IP地址。
Find the IP of your LoadBalancer, and change it from ephemeral to static. 找到您的LoadBalancer的IP,并将其从临时更改为静态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.