Generally you do not want to assign a static IP to a pod, you want to create a service which will have a static private IP, and then assign the pod to the service. Assigning a private static IP to a pod is an anti-pattern in Kubernetes and isn't supported in standard Kubernetes. Certain CNI plugins may allow you to do this, but I don't believe the AKS ones will.
static private IP for PODs inside AKS?
AKS supports static public IP assignment for a POD. Anyway I can assign static private IP for a POD? Example to create a service that application pods can use as default gateway?
Thank you!
Azure Kubernetes Service
2 answers
Sort by: Most helpful
-
Sam Cogan 10,812 Reputation points Microsoft Employee Volunteer Moderator
2021-10-07T08:32:08.837+00:00 -
Haitao Huang 51 Reputation points
2021-10-07T17:14:02.117+00:00 @Sam Cogan , thank you! I think I did not get my question right in a way. I am trying to insert a service in AKS, one side facing Pod as nat or gateway for pods, other side facing outside for service access. Two challenges, one is to support multiple interfaces (seems not supported) or IP addresses (?), second is to assign a static pod gw or snat address. I found static public IP assignment for AKS which could be used for outside facing part, but not sure internal pod facing gw/snat address.
It seems this setup probably is not going to work :(. Thank you!