Kubernetes集群传出流量IP [英] Kubernetes cluster outgoing traffic IP
问题描述
我在Google Kubernetes Engine上有一个Kubernetes集群.我想为群集的所有传出流量分配一个静态IP.
I have a Kubernetes cluster on Google Kubernetes Engine. I want to assign a static IP for all outgoing traffic of a cluster.
我已经保留了外部IP,但是无法使用GCP控制台将其分配给群集.
I already have reserved external IPs but I can't assign them to a cluster with the GCP console.
我找到了使用cli的解决方案: Kubernetes中的静态传出IP
I found a solution to do it with the cli : Static outgoing IP in Kubernetes
,但是它以VM为目标,因此每次部署时都需要对其进行设置.因此,它不是针对集群的.
but it targets the VM and I will need to set it each time I deploy. So it's not targeting the cluster.
有人可以提供任何指针吗?谢谢.
Can anybody provide any pointers? Thanks.
推荐答案
GKE当前无法选择使用保留的公共IP创建包含所有节点的群集.您在高级联网选项中获得的一切都是这样的:
GKE currently doesn't have an option to create the cluster with all your nodes using a reserved public IP. All you get in advanced networking options is something like this:
您将必须使用您提到的gcloud
API,该API应该易于放置在脚本中.
You will have to use the gcloud
API that you mentioned which should be easy to put in a script.
或者您也可以通过编辑实例并进入网络接口"来使用UI,如下所示:
Or you can also use the UI by editing the instance(s) and going into 'Network Interfaces' like this:
这篇关于Kubernetes集群传出流量IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!