如何为我的EKS服务分配静态IP? [英] How can I assign a static IP to my EKS service?

查看:54
本文介绍了如何为我的EKS服务分配静态IP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个EKS集群.

我创建了我的服务,并使用ingress-nginx公开了它.

I created my service and exposed it using ingress-nginx.

ingress-nginx外部IP显示为DNS名称而不是IP.

ingress-nginx external IP appears as a DNS name and not as IP.

如何连接我的私有域以指向我的EKS服务?

How can I connect my private domain to point to my EKS service?

我知道有一个将AWS Elastic IP与Kubernetes一起使用的注释,

I know that there is an annotation for using AWS Elastic IP with Kubernetes,

但它仅从Kubernetes 1.16开始可用,并且EKS仅支持1.14.

but it's only available starting from Kubernetes 1.16 and EKS supports only up to 1.14.

那么为我的服务分配一些静态IP并配置DNS指向该IP的选项是什么?

So what are my options to assign some static IP to my service and configure my DNS to point this IP?

推荐答案

将静态IP地址分配给AWS Load Balancer

在这种情况下,此帖子的答案仍然正确.

The answer to this post still rings true in this case.

Amazon执行负载平衡的方式是它将根据需要扩展和缩小接口以处理请求负载.这就是为什么他们为您分配域名而不是IP地址的原因,因为您的负载均衡器可能具有多个物理接口,并且IP地址会经常更改.

The way Amazon does load balancing is it will scale up and down interfaces as needed to handle the request load. This is why they assign you a domain name instead of an IP address since your load balancer could have multiple physical interfaces and the IP addresses will frequently change.

如果您要做的只是为负载均衡器创建DNS名称,则可以通过创建指向负载均衡器dns名称的 CNAME 记录,对任何DNS提供程序都可以轻松完成此操作由AWS设置.如果您使用的是Route53,则它甚至更简单,因为您只需创建一个具有DNS名称别名的A记录即可.

If all you are trying to do is create a DNS name for your load balancer, this can simply be done with any DNS provider by creating a CNAME record pointing to the dns name of the load balancer provisioned by AWS. If you are using Route53, it is even simpler since you can just create an A record with an alias to the DNS name.

我希望这会有所帮助.FWIW,除非您仅将其部署在一个可用区中,否则不可能为您的负载均衡器获得一个静态IP地址.

I hope this helps. FWIW, it is not possible to get a single static IP address for your load balancer unless you are only deploying it in one Availability Zone.

这篇关于如何为我的EKS服务分配静态IP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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