CompositionalIT / farmer

Repeatable Azure deployments with ARM templates - made easy!
https://compositionalit.github.io/farmer
MIT License
527 stars 159 forks source link

Container Group DNS configuration #913

Closed ninjarobot closed 2 years ago

ninjarobot commented 2 years ago

This PR closes #893

The changes in this PR are as follows:

I have read the contributing guidelines and have completed the following:

If I haven't completed any of the tasks above, I include the reasons why here:

Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure:

arm {
    add_resources [
        vnet {
            name "mynetwork"
            add_address_spaces [
                "10.30.32.0/20"
            ]
            add_subnets [
                subnet {
                    name "containers"
                    prefix "10.30.41.0/24"
                    add_delegations [ SubnetDelegationService.ContainerGroups ]
                }
            ]
        }
        networkProfile {
            name "netprofile"
            vnet "mynetwork"
            subnet "containers"
        }
        containerGroup {
            name "container-group-with-custom-dns"
            dns_nameservers [ "8.8.8.8"; "1.1.1.1" ]
            dns_search_domains [ "example.com"; "example.local" ]
            network_profile "netprofile"
            add_instances [
                containerInstance {
                    name "httpserver"
                    image "nginx"
                }
            ]
        }
    ]
}
ninjarobot commented 2 years ago

@et1975 can you please review? This adds support for setting the DNS configuration on vnet-attached container groups.

ninjarobot commented 2 years ago

@et1975 this is released in 1.6.33 now available on nuget.