Connect AKS Cluster to a Virtual network hosting Virtual machines

5/21/2019

I recently created an AKS hosting cluster our microservices architecture.

However, we do have some services that cannot be contained like the rest.

My need is to be able to connect the virtual network on which my cluster is located to that of my virtual machines.

I would like to know what is the best way to do this action?

I have so far created two "virtual network gateway" that I have tried to connect between them. However, the status of the connection always remains on "Connecting"

And when I connect to one of the pods in the cluster, the connection doesn't work.

Is there any other way to make it work?

-- Rolljee
azure
azure-aks
kubernetes

2 Answers

5/21/2019

Its a lot easier (and cheaper) to use virtual network peering, you can follow this tutorial to peer two networks.

Also, you need to use Azure CNI when creating the AKS cluster (needs recreating, cant alter it after AKS was created), this way every pod will get a dedicated IP address, they would be able to utilize connection between virtual networks.

You can also use gateways, but since peering now works globally it makes very little sense to use gateways\site-to-site

-- 4c74356b41
Source: StackOverflow

5/21/2019

I think Azure CNI will fulfill your need. Since every pod gets an IP address from the subnet and can be accessed directly.

-- Sajeetharan
Source: StackOverflow