<p>I am building a Kubernetes Cluster on Azure (AKS). I have deployed it into a custom VNet using <a href="https://github.com/Azure/AKS/issues/27#issuecomment-370627500" rel="nofollow noreferrer">this</a> document. By default, the VNet that gets created when AKS is provisioned is 10.0.0.0/8. All of our infrastructures are in 10.27.X.X space hence the need for the custom VNet.</p>

<p>As per the document the Custom VNet is created in a separate Resource Group, in our case Azure.Prod. In the same group, we have established the Virtual Network Gateway for the VPN back to our Data Centre.</p>

<p>Here is the details (obfuscated) of our config:</p>

<ul>
<li>Resource group Azure.Prod </li>
<li>Resource group MC_Azure.Prod (created by AKS)</li>
<li>Virtual network 10.150.0.0/16 in Azure.Prod</li>
<li>Subnet 10.150.1.0/24</li>
<li>Virtual machine 10.150.1.4 in MC_Azure.Prod</li>
<li>Pod network 10.244.0.0/24</li>
<li>Data centre network 10.27.16.x/24</li>
</ul>

<p>One of the containers needs to make a SQL Connection back to the Data Centre but it is failing. I am able to ping 10.150.1.4 from a machine in the data centre so have proved connectivity from DC to Azure.</p>

<p>I have added the following routes in the route table that was created by AKS, followed <a href="https://stackoverflow.com/questions/46277845/k8s-pods-unable-to-reach-external-vm-via-internal-ip/46291889">this</a> article.</p>

<ul>
<li>10.27.16.0/24 > Virtual Network Gateway</li>
</ul>

<p>On the machine in the Data Centre, I have created the following route</p>

<ul>
<li>10.244.0.0/24 > 10.27.16.3 (which is the GW on the DC NW, the device also terminates the VPN)</li>
</ul>

<p>Any help appreciated!</p>

<p>Right, I finally got to the bottom of this, looks like the routes back to the data centre and also to the pods need to be replicated on the GatewaySubnet as well.</p>
