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

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

问题描述

我正在运行一个裸机Kubernetes集群,并尝试使用负载均衡器公开我的服务.我通常知道负载均衡器是底层公共云的功能,但是随着最近对Ingress Controller的支持,现在看来应该可以将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 Ingress Controller及其背后的一些测试服务.但是,我无法执行步骤6,该步骤显示负载均衡器所运行的节点的外部IP,因为我的节点在地址部分中没有外部IP,只有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.

我尝试通过在服务的规范中指定将外部IP手动分配给群集.但是,它似乎被映射为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.

如何手动设置节点的外部IP地址?

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天全站免登陆