简体   繁体   English

AKS POD 新 IP 的应用网关

[英]Application Gateway to pickup new IP of AKS POD

I have a simple site running in AKS which is load balanced with an application gateway.我有一个在 AKS 中运行的简单站点,它与应用程序网关进行负载平衡。 The pod IP for the site is setup as a backend pool in the AGW but if I restart the pod, the IP changes therefor the backend pool will break.该站点的 pod IP 被设置为 AGW 中的后端池,但是如果我重新启动该 pod,IP 更改,因此后端池将中断。

Is there anyway AGW can pickup the POD's name rather then using its IP address, so if we do restart a pod, it will still be available in the back end pool?无论如何,AGW 是否可以获取 POD 的名称,而不是使用其 IP 地址,所以如果我们重新启动一个 pod,它仍然可以在后端池中使用?

Thanks谢谢

Thank You CSharpRocks for your suggestion.感谢CSharpRocks的建议。

Would suggest you to use the Cluster IP to front your POD because ClusterIP cannot be changed, but External IP can.建议您使用集群 IP 放在您的 POD 前面,因为集群 IP 无法更改,但外部 IP 可以。

在此处输入图像描述

you might lose the external IP forever;您可能会永远丢失外部 IP; with cloud providers, for example, if you haven't reserved it previously.例如,如果您之前没有预订过云提供商。

You can edit the service and change the external IP, or change the service type, in which case it will lose it automatically, and change it back to LoadBalancer type, later on, with different IP address.您可以编辑服务并更改外部 IP,或更改服务类型,在这种情况下它会自动丢失,然后将其更改回LoadBalancer类型,稍后使用不同的 IP 地址。

But to change the ClusterIP you have to delete the service.但是要更改ClusterIP ,您必须删除该服务。

Reference: Can a kubernetes service change IP when rolling out/restart my app参考: 推出/重新启动我的应用程序时,kubernetes 服务是否可以更改 IP

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM