static private IP for PODs inside AKS?

Haitao Huang 51 Reputation points
2021-10-06T18:11:42.577+00:00

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
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,459 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sam Cogan 10,812 Reputation points Microsoft Employee Volunteer Moderator
    2021-10-07T08:32:08.837+00:00

    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.

    0 comments No comments

  2. 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!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.