简体   繁体   English

GKE上的Kubernetes:将负载均衡器绑定到特定IP

[英]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.

相关问题 如何在GKE中使用临时IP创建Kubernetes负载均衡器? - How can I create Kubernetes load balancer with an ephemeral IP in GKE? Flask 不适用于 Kube.netes (GKE) 负载均衡器 IP 地址 - Flask not working on Kubernetes (GKE) Load balancer IP address gke 上的 kubernetes / 为什么强制使用负载均衡器? - kubernetes on gke / why a load balancer use is enforced? RunAsUser 问题 & 单击负载均衡器的外部 IP -> 在 GKE (Kubernetes) 上部署 Django 应用程序时出现错误请求 (400) 并且数据库连接失败: - RunAsUser issue & Clicking external IP of load balancer -> Bad Request (400) on deploying Django app on GKE (Kubernetes) and db connection failing: 如何将nginx与Kubernetes(GKE)和Google HTTPS负载均衡器配合使用 - How to use nginx with Kubernetes (GKE) and Google HTTPS load balancer Kube.netes (GCE/GKE) 上的 Traefik 支持 GCE 负载均衡器 - Traefik on Kubernetes (GCE/GKE) behind GCE Load Balancer 将 kubernetes(GKE) 服务层指标发送到 GCP 负载均衡器 - Send kubernetes(GKE) service layer metrics to GCP Load Balancer Kubernetes 负载平衡器外部 IP 待处理 - Kubernetes load balancer External IP pending Kubernetes负载均衡器服务包源IP - Kubernetes load balancer service packet source IP 外部 ip 待定 Kubernetes 负载均衡器 - External ip pending Kubernetes Load balancer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM