assign kubernetes loadbalancer an ip from an internal network

7/19/2018

I am having an aks instance running. which I assigned an virtual network to it. So all the Node IPs in the network are good and I can reach them from within the network.

Now I wonder if it is possible to create a 2nd virtual network and tell kubernetes to use it to assign public ips ?

Or maybe is it possible to say that a specific service should always have the same node ip ?

-- Safari
azure
kubernetes

1 Answer

7/19/2018

No, this is not supported, you might be able to hack your way through, but certainly not out of the box.

But you can create an internal load balancer for your service in the network and its ip wouldnt change, you do this using a service with an annotation:

---
apiVersion: v1
kind: Service
metadata:
  name: name
  annotations:
    service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
  ports:
  - port: xxx
  selector:
    app: name
  type: LoadBalancer
-- 4c74356b41
Source: StackOverflow