<p>I have AZ VM window which installed MSSQL
I created cluster in AZ K8S, then create the pod with image - application run with embedded tomcat using MSSQL connect to private IP of the above VM. The container in the pod start with error: can not connect to that private IP of MSSQL
I can access to that private IP from my local machine (using VPN), so is there any way/config to make pod can connect to that VM using private IP ? since it's same infrastructure, I dont why it cannot connect
(I am newbie with Azure)
Thanks alot</p>

Cam Lâm Văn
<p>For your requirement, I don't know how do you deploy the VM and the AKS cluster. So I give the solutions for the two situations:</p>
<ol>
<li>AKS cluster with the network type kubelet:
<ol>
<li>VM in VNet A and AKS in VNet B
create a service with the internal load balancer for the pod, and then peer the VNet A and B</li>
<li>VM and AKS in the same VNet
create a service with the internal load balancer for the pod</li>
</ol>
</li>
<li>AKS cluster with the network type CNI
<ol>
<li>VM in VNet A and AKS in VNet B
peer the VNet A and B</li>
<li>VM and the AKS in the same VNet
you don't do anything, it should work</li>
</ol>
</li>
</ol>
<p>All of the above solutions need you to check the NSG rules between the VM and the AKS cluster pod. You need to allow the inbound traffic to the VM with the MSSQL port.</p>
