Skip to content
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. #14549

Merged
merged 5 commits into from
Jun 22, 2023

Conversation

oleksandrivantsiv
Copy link
Collaborator

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

  • Run the image compilation. Each component related to the static DNS feature is covered with the unit tests.
  • Run sonic-mgmt tests. Static DNS feature will be covered with the system tests.
  • Install the image and run manual tests.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

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)

@oleksandrivantsiv
Copy link
Collaborator Author

This is the re-creation of #14239, which was closed by mistake

ganglyu
ganglyu previously approved these changes Apr 12, 2023
@@ -0,0 +1,7 @@
#!/bin/bash

for container in $(docker ps -a --format=" {{ .ID }}"); do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some containers like telemetry will start after 3 minutes.
If we upgrade SONiC image, and start the system for the first time, can we update /etc/resolv.conf in telemetry container?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker ps -a command returns all existing containers on the system. And we will update /etc/resolv.conf file for all containers including those that are not running.

For the case when the container is created in the runtime (for example app extension), when the dockerd starts the container it copies /etc/resolv.conf file from the host OS into the container filesystem. So, we will always have a valid DNS configuration inside the containers.

@liat-grozovik
Copy link
Collaborator

@ganglyu would you please refer to comments and help to approve?

@liat-grozovik liat-grozovik merged commit 475fe27 into sonic-net:master Jun 22, 2023
dgsudharsan added a commit to dgsudharsan/sonic-buildimage that referenced this pull request Jun 30, 2023
dgsudharsan added a commit to dgsudharsan/sonic-buildimage that referenced this pull request Jul 5, 2023
vivekrnv added a commit to vivekrnv/sonic-buildimage that referenced this pull request Jul 7, 2023
ganglyu added a commit to sonic-net/sonic-utilities that referenced this pull request Jul 12, 2023
What I did
sonic-net/sonic-buildimage#14549
This PR has introduced DNS configuration to CONFIG_DB, we need to migrate original CONFIG_DB to support DNS configuration during upgrading SONiC.

How I did it
If there's no DNS_NAMESERVER table in CONFIG_DB, read DNS_NAMESERVER table from minigraph and update CONFIG_DB.

How to verify it
Run unit test for db migrator.
dgsudharsan added a commit to dgsudharsan/sonic-buildimage that referenced this pull request Jul 21, 2023
rajkumar38 pushed a commit to rajkumar38/sonic-utilities that referenced this pull request Jul 25, 2023
What I did
sonic-net/sonic-buildimage#14549
This PR has introduced DNS configuration to CONFIG_DB, we need to migrate original CONFIG_DB to support DNS configuration during upgrading SONiC.

How I did it
If there's no DNS_NAMESERVER table in CONFIG_DB, read DNS_NAMESERVER table from minigraph and update CONFIG_DB.

How to verify it
Run unit test for db migrator.
rajkumar38 pushed a commit to rajkumar38/sonic-utilities that referenced this pull request Jul 25, 2023
What I did
sonic-net/sonic-buildimage#14549
This PR has introduced DNS configuration to CONFIG_DB, we need to migrate original CONFIG_DB to support DNS configuration during upgrading SONiC.

How I did it
If there's no DNS_NAMESERVER table in CONFIG_DB, read DNS_NAMESERVER table from minigraph and update CONFIG_DB.

How to verify it
Run unit test for db migrator.
@StormLiangMS
Copy link
Contributor

@oleksandrivantsiv @ganglyu For me, this looks like a feature other than bug fix, if so, not to 202305.

@liat-grozovik
Copy link
Collaborator

liat-grozovik commented Aug 6, 2023 via email

@oleksandrivantsiv
Copy link
Collaborator Author

@StormLiangMS can we finalize this? Should we backport the changes to 202305?

Thanks,
Oleksandr

pdhruv-marvell pushed a commit to pdhruv-marvell/sonic-utilities that referenced this pull request Aug 23, 2023
What I did
sonic-net/sonic-buildimage#14549
This PR has introduced DNS configuration to CONFIG_DB, we need to migrate original CONFIG_DB to support DNS configuration during upgrading SONiC.

How I did it
If there's no DNS_NAMESERVER table in CONFIG_DB, read DNS_NAMESERVER table from minigraph and update CONFIG_DB.

How to verify it
Run unit test for db migrator.
rajkumar38 pushed a commit to rajkumar38/sonic-utilities that referenced this pull request Aug 28, 2023
What I did
sonic-net/sonic-buildimage#14549
This PR has introduced DNS configuration to CONFIG_DB, we need to migrate original CONFIG_DB to support DNS configuration during upgrading SONiC.

How I did it
If there's no DNS_NAMESERVER table in CONFIG_DB, read DNS_NAMESERVER table from minigraph and update CONFIG_DB.

How to verify it
Run unit test for db migrator.
sonic-otn pushed a commit to sonic-otn/sonic-buildimage that referenced this pull request Sep 20, 2023
- 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
Run the image compilation. Each component related to the static DNS feature is covered with the unit tests.
Run sonic-mgmt tests. Static DNS feature will be covered with the system tests.
Install the image and run manual tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants