microsoftfeedback / aci-issues

Issue reporting and tracking for the Azure Container Instances service
Creative Commons Attribution 4.0 International
7 stars 0 forks source link

DNS resolution for Linux containers group attached to an Azure virtual network #25

Open dwrightpulse opened 6 years ago

dwrightpulse commented 6 years ago

I've been doing some testing/trial deployments with Linux containers attached to a private Azure VNet.

The containers launch and run as expected with an auto assigned private IP in the subnet's range - so far so good. The VNet has custom DNS servers set (and Windows VM's attached to a different subnet in the VNet inherit these DNS servers correctly) but none of the Linux containers inherit the custom DNS servers. Looking at the /etc/resolv.conf file I can see that the containers get a DNS server address of 168.63.129.16 with a DNS search domain of .ax.internal.cloudapp.net.

How can I get the containers to inherit the DNS server settings set at the VNet? (I am creating the container groups using az container create with a .YAML file)

Thanks

yangl900 commented 5 years ago

You can customize the DNS server when you create the container groups. A JSON example is here:

https://github.com/Azure/azure-rest-api-specs/blob/21f0dcbb89544101d79be7fc889a86ce0911901b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2018-10-01/examples/ContainerGroupsCreateOrUpdate.json#L73

"dnsConfig": {
          "nameServers": [ "1.1.1.1" ],
          "searchDomains": "cluster.local svc.cluster.local",
          "options": "ndots:2"
},

YAML would be similar. Hope this helps.

dwrightpulse commented 5 years ago

That's great - thanks for the info and works a treat for me...

Do you know what does the "ndots:2" does? I have tried without and with in the YAML and seemingly no difference...

2 other points you may be able to shed light on: 1) is there a way to get the containers to do dynamic DNS registration (eg against a Windows Server running DNS) 2) If 1 not possible is it possible to specify a specific IP address on the VNet for the container group to use within the YAML?