diff --git a/doc/static-dns/images/static_dns_containers_update.svg b/doc/static-dns/images/static_dns_containers_update.svg new file mode 100755 index 0000000000..ef6db2c19c --- /dev/null +++ b/doc/static-dns/images/static_dns_containers_update.svg @@ -0,0 +1,4 @@ + + + +
resolvconf
resolvconf
DNS configuration update
(/etc/resolv.conf changed)
DNS configurati...
update-container
plugin
update-container...
docker
docker
update DNS configuration
in /etc/resolv.conf file
update DNS conf...
frame
frame
[for each docker container]
[for each do...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/static-dns/static_dns.md b/doc/static-dns/static_dns.md index ba75b6d03b..883641f652 100755 --- a/doc/static-dns/static_dns.md +++ b/doc/static-dns/static_dns.md @@ -39,13 +39,15 @@ between programs that supply nameserver information and applications that use th - Provide a possibility to configure static DNS entries via Config DB. - The default behavior should be preserved if no static DNS entries are configured. - New CLI command for static DNS configuration. +- DNS configuration should be updated in the host OS and all existing docker containers. ### Architecture Design 1. CLI is responsible for putting DNS static configuration to Config DB. 2. hostcfgd should be extended to handle static DNS configuration by listening to Config DB change. 3. A new resolv-config.service systemd service should be added to control recolvconf framework. -4. A new resolv.conf.j2 template file should be added to generate resolv.conf file with static DNS configuration. +4. A new resolv.conf.j2 template file should be added to generate resolv.conf file with static DNS configuration. +5. A new resolvconf plugin ("update-containers") should be added to update the DNS configuration inside each existing docker container. #### CLI flow @@ -60,7 +62,10 @@ between programs that supply nameserver information and applications that use th ![static_dns_init_hostcfgd](/doc/static-dns/images/static_dns_init_hostcfgd.svg) #### Runtime configuration changes ![static_dns_runtime_config](/doc/static-dns/images/static_dns_runtime_config.svg) +#### Containers configuration update +`resolvconf` will call the `update-containers` plugin after the DNS configuration update, to notify about the configuration change. `update-containers` plugin will update the DNS configuration in each docker container by copying `/etc/resolv.conf` file into the container filesystem. The plugin will be called regardless if the information was received dynamically from the DHCP server or configured manually by the user via config command. +![static_dns_containers_update](/doc/static-dns/images/static_dns_containers_update.svg) ### High-Level Design Changes should be added to sonic-buildimage and sonic-utilities repositories. CLI changes of sonic-utilities will be covered in the chapter "Configuration and management". @@ -159,7 +164,21 @@ Config DB will be extended with the following table: }, } ``` - + +#### Minigraph Config Enhancements + +A new "DnsNameserverResources" property will be added to the Minigraph + +```xml + + DnsNameserverResources + + "IP addresses list" + +``` + +`sonic-cfggen` will be extended to translate configuration specified in "DnsNameserverResources" property into "DNS_NAMESERVER" Config DB table. + ### Warmboot and Fastboot Design Impact The feature has no impact on the warmboot and fastboot. @@ -176,6 +195,7 @@ The feature doesn't require special handling during the config migration. 2. Verify command "config dns nameserver del" 3. Verify command "show dns nameserver" 4. Verify the configuration generated by resolv.conf.j2 template +5. Verify the configuration generated from minigraph #### System Test cases System test cases should be implemented in sonic-mgmt. A few new test cases should be added: