-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dns] Add support for static DNS configuration. #14239
Conversation
Does this feature cover DNS configuration inside container? For example, "docker exec telemetry cat /etc/resolv.conf" |
Yes. During the container start the docker daemon copies "/etc/resolv.conf" from the host OS rootfs to the docker container rootfs. |
|
|
||
start() | ||
{ | ||
redis-dump -d 4 -k "DNS_NAMESERVER*" -y > /tmp/dns.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your intention is to check if the table is empty, no need to dump.
4 is magic number, you may consider sonic-db-cli
with CONFIG_DB
.
@judyjoseph to check multi-asic and T2.
Wondering if KUBELET_EXTRA_ARGS is impacted by this new feature? @lixiaoyuner could you help review? Refers to: files/build_templates/sonic_debian_extension.j2:477 in 4fd0180. [](commit_id = 4fd01802a87f2edfe5ac75651ac5e3c7dacf146e, deletion_comment = False) |
@@ -0,0 +1,3 @@ | |||
{% for ip in DNS_NAMESERVER|sort %} | |||
nameserver {{ ip }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are mutually exclusive approaches. If the user wants to edit /etc/resolv.conf manually it should not configure DNS via config DB and vice-versa. The default behavior is preserved if no DNS entries are specified in the config DB.
@@ -0,0 +1,6 @@ | |||
{ | |||
"DNS_NAMESERVER": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yang model and tests are added: #13834
4fd0180
to
6f54251
Compare
Why I did it
Add support for static DNS configuration. According to sonic-net/SONiC#1262 HLD.
How I did it
Add a new
resolv-config.service
that is responsible for transferring configuration from Config DB into/etc/resolv.conf
file that is consumed by various subsystems in Linux to resolve domain names into IP addresses.How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)