为节点分配外部 IP [英] Assign an External IP to a Node

查看:29
本文介绍了为节点分配外部 IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个裸机 Kubernetes 集群并尝试使用负载均衡器来公开我的服务.我通常知道负载均衡器是底层公共云的一个功能,但随着最近对入口控制器的支持,似乎现在应该可以使用 nginx 作为自托管负载均衡器.

I'm running a bare metal Kubernetes cluster and trying to use a Load Balancer to expose my services. I know typically that the Load Balancer is a function of the underlying public cloud, but with recent support for Ingress Controllers it seems like it should now be possible to use nginx as a self-hosted load balancer.

到目前为止,我一直在关注这里的示例 设置一个 nginx 入口控制器和它背后的一些测试服务.但是,我无法按照第 6 步显示负载均衡器运行所在节点的外部 IP,因为我的节点在地址部分没有 ExternalIP,只有 LegacyHostIP 和 InternalIP.

So far, i've been following the example here to set up an nginx Ingress Controller and some test services behind it. However, I am unable to follow Step 6 which displays the external IP for the node that the load balancer is running on as my node does not have an ExternalIP in the addresses section, only a LegacyHostIP and InternalIP.

我已尝试通过在服务规范中指定一个 ExternalIP 来手动将其分配给我的集群.但是,这似乎被映射为 externalID.

I've tried manually assigning an ExternalIP to my cluster by specifying it in the service's specification. However, this appears to be mapped as the externalID instead.

如何手动设置节点的 ExternalIP 地址?

How can I manually set my node's ExternalIP address?

推荐答案

我建议查看 MetalLB:https://github.com/google/metallb

I would suggest checking out MetalLB: https://github.com/google/metallb

它允许使用 ARP 或 BGP 在裸机集群中使用外部 IP 地址.它对我们很有用,并允许您像在云中一样简单地请求 LoadBalancer 服务.

It allows for externalIP addresses in a baremetal cluster using either ARP or BGP. It has worked great for us and allows you to simply request a LoadBalancer service like you would in the cloud.

这篇关于为节点分配外部 IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆