-
Notifications
You must be signed in to change notification settings - Fork 931
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
Doc: Better DNS persistence solution for systemd #14589
base: main
Are you sure you want to change the base?
Conversation
Hi @simondeziel and @tomponline , I've re-submitted the PR as you asked. I've added information regarding the situation Simon has encountered, and also opened #14588 , because |
@kkovacs If the existing |
I'm not very familiar with The But of course, it's up to the LXD project how to do this. I would be most happier if resolving the |
Please sign the CLA https://ubuntu.com/legal/contributors/agreement |
Please can you also rebase as main has fixes for some linter issues that are blocking the tests. |
50cc98f
to
cd26ca4
Compare
I did!
I did :) |
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.
Please can you sign off your commits.
See https://github.com/canonical/lxd/blob/main/CONTRIBUTING.md#developer-certificate-of-origin
The CLA check is failing with
|
…ntainers from the host machine. Signed-off-by: Kristof Kovacs <[email protected]>
cd26ca4
to
878d2a5
Compare
Signed off, removed "apparently", fixed "author", rebased, pushed. Fingers crossed. :) |
DCO and CLA check are good :) |
@minaelee happy with this? |
Co-authored-by: Minae Lee <[email protected]> Signed-off-by: K Kovács <[email protected]>
Thank you @minaelee! It's incredible how much clearer you have made the text. Kudos! |
@@ -72,7 +72,70 @@ You must repeat the commands after each reboot and after LXD is restarted, or ma | |||
|
|||
You can automate the `systemd-resolved` DNS configuration, so that it is applied on system start and takes effect when LXD creates the network interface. |
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.
You can automate the `systemd-resolved` DNS configuration, so that it is applied on system start and takes effect when LXD creates the network interface. |
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.
This is repeated in line 75
@@ -72,7 +72,70 @@ You must repeat the commands after each reboot and after LXD is restarted, or ma | |||
|
|||
You can automate the `systemd-resolved` DNS configuration, so that it is applied on system start and takes effect when LXD creates the network interface. | |||
|
|||
To do so, create a `systemd` unit file named `/etc/systemd/system/lxd-dns-<network_bridge>.service` with the following content: | |||
You can automate the systemd-resolved DNS configuration so that it is applied on system start and takes effect when LXD creates the network interface. To do so, there are two approaches you can take, detailed below. Use only one of the approaches. |
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.
You can automate the systemd-resolved DNS configuration so that it is applied on system start and takes effect when LXD creates the network interface. To do so, there are two approaches you can take, detailed below. Use only one of the approaches. | |
There are two approaches to automating `systemd-resolved` configuration to ensure that it persists when the LXD bridge network is re-created. Use only one of these approaches, described below. |
To do so, create a `systemd` unit file named `/etc/systemd/system/lxd-dns-<network_bridge>.service` with the following content: | ||
You can automate the systemd-resolved DNS configuration so that it is applied on system start and takes effect when LXD creates the network interface. To do so, there are two approaches you can take, detailed below. Use only one of the approaches. | ||
|
||
The first approach is recommended as more resilient; it is reapplied if the lxdbr0 network is re-created at any point. For example, updating and restarting LXD can occasionally cause the lxdbr0 network to be recreated. |
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.
The first approach is recommended as more resilient; it is reapplied if the lxdbr0 network is re-created at any point. For example, updating and restarting LXD can occasionally cause the lxdbr0 network to be recreated. | |
The first approach is recommended because it is more resilient. It applies your desired configuration whenever your system is rebooted, _and_ whenever the LXD bridge network is re-created outside of a system reboot. For example, updating and restarting LXD can occasionally cause its bridge network to be re-created. |
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.
Suggested updates based on this conversation, thanks!
|
||
The first approach is recommended as more resilient; it is reapplied if the lxdbr0 network is re-created at any point. For example, updating and restarting LXD can occasionally cause the lxdbr0 network to be recreated. | ||
|
||
If you are unable to use the recommended approach for some reason, the second alternative approach can be used. However, if the lxdbr0 network is re-created, you must reapply that solution manually. |
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 you are unable to use the recommended approach for some reason, the second alternative approach can be used. However, if the lxdbr0 network is re-created, you must reapply that solution manually. | |
If you are unable to use the recommended approach, the alternative approach can be used. The alternative approach applies your desired configuration only when your system is rebooted. If LXD re-creates its bridge network outside of a system reboot, you must reapply the configuration manually. |
Domains=~<dns_domain> | ||
``` | ||
|
||
So for example, `/etc/systemd/network/lxdbr0.network` with the following content (your IP, of course): |
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.
So for example, `/etc/systemd/network/lxdbr0.network` with the following content (your IP, of course): | |
Example file content for `/etc/systemd/network/lxdbr0.network` (insert your own DNS value): |
``` | ||
|
||
### Alternative approach | ||
|
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.
```{warning} | |
This approach only automates applying your desired configuration when your system is rebooted. If LXD re-creates its bridge network outside of a system reboot, you must reapply the configuration manually with the following command: | |
systemctl restart lxd-dns-<bridge_network>.service | |
Example: | |
systemctl restart lxd-dns-lxdbr0.service | |
``` | |
Amended documentation with a better way to setup DNS-resolving LXD containers from the host machine.
This is a re-submit of #14572 .