-
Notifications
You must be signed in to change notification settings - Fork 129
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
network: Add nmstate examples #536
base: main
Are you sure you want to change the base?
Conversation
Now that nmstate is part of fcos the network configuration examples should be extended with it. Also fixed `10.10.10.1` been listed as IP address in NetworkManager key file, it is supposed to be a gateway IP, not IP address of NIC. Signed-off-by: Enrique Llorente <[email protected]> Signed-off-by: Gris Ge <[email protected]>
@dustymabe Any remaining task should I do to get this merged? |
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.
Thank you for working on this! I left some comments inline in the changes. I think ultimately the format of this is a bit unwieldy for the user, but I think having tabs support (which I've requested) will make this much better. We don't need to block on that here, though.
enable: true | ||
address: | ||
- ip: 10.10.10.10 | ||
prefix-length: 24 |
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 later examples include a routes:
entry in the nmstate yml file. I'm not sure I understand why those include it and this one doesn't?
@@ -99,12 +99,15 @@ See https://coreos.github.io/afterburn/usage/initrd-network-cmdline/[the Afterbu | |||
|
|||
WARNING: If you need networking to grab your Ignition config and your environment requires more complex networking than the default of DHCP to grab the Ignition config, then you'll need to use another method other than Ignition to configure the network. | |||
|
|||
Networking configuration can be performed by writing out files described in an Ignition config. These are https://networkmanager.dev/docs/api/latest/nm-settings-keyfile.html[NetworkManager keyfiles] that are written to `/etc/NetworkManager/system-connections/` that tell NetworkManager what to do. | |||
There are to main methods for configuring networking with ignition |
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 are to main methods for configuring networking with ignition | |
There are two main methods for configuring networking by delivering text configuration files via Ignition: |
Also Let's add a blank line after this line so the bullets get broken out properly by antora/asciidoctor
@@ -99,12 +99,15 @@ See https://coreos.github.io/afterburn/usage/initrd-network-cmdline/[the Afterbu | |||
|
|||
WARNING: If you need networking to grab your Ignition config and your environment requires more complex networking than the default of DHCP to grab the Ignition config, then you'll need to use another method other than Ignition to configure the network. | |||
|
|||
Networking configuration can be performed by writing out files described in an Ignition config. These are https://networkmanager.dev/docs/api/latest/nm-settings-keyfile.html[NetworkManager keyfiles] that are written to `/etc/NetworkManager/system-connections/` that tell NetworkManager what to do. | |||
There are to main methods for configuring networking with ignition | |||
- By creating NetworkManager configuration files described in an Ignition config. These are https://networkmanager.dev/docs/api/latest/nm-settings-keyfile.html[NetworkManager keyfiles] that are written to `/etc/NetworkManager/system-connections/` that tell NetworkManager what to do. |
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.
I think we can shorten this now:
- By creating NetworkManager configuration files described in an Ignition config. These are https://networkmanager.dev/docs/api/latest/nm-settings-keyfile.html[NetworkManager keyfiles] that are written to `/etc/NetworkManager/system-connections/` that tell NetworkManager what to do. | |
- By creating https://networkmanager.dev/docs/api/latest/nm-settings-keyfile.html[NetworkManager keyfiles] that are written to `/etc/NetworkManager/system-connections/` that tell NetworkManager what to do. |
Networking configuration can be performed by writing out files described in an Ignition config. These are https://networkmanager.dev/docs/api/latest/nm-settings-keyfile.html[NetworkManager keyfiles] that are written to `/etc/NetworkManager/system-connections/` that tell NetworkManager what to do. | ||
There are to main methods for configuring networking with ignition | ||
- By creating NetworkManager configuration files described in an Ignition config. These are https://networkmanager.dev/docs/api/latest/nm-settings-keyfile.html[NetworkManager keyfiles] that are written to `/etc/NetworkManager/system-connections/` that tell NetworkManager what to do. | ||
- By creating a nmstate desire state YAML(postfix .yml) files at /etc/nmstate following https://nmstate.io[NMstate syntax]. The applied network state file will be renamed with postfix .applied to prevent repeated applied on next run. |
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.
I assume everywhere in this file we should be consisten with the capitalization of NMstate
? Also a few wording suggestsion:
- By creating a nmstate desire state YAML(postfix .yml) files at /etc/nmstate following https://nmstate.io[NMstate syntax]. The applied network state file will be renamed with postfix .applied to prevent repeated applied on next run. | |
- By creating NMstate desired state YAML files with the `.yml` suffix under `/etc/nmstate/` following the https://nmstate.io[NMstate syntax]. The state files will be applied and then renamed with a `.applied` suffix to prevent being processed again. |
|
||
Any configuration provided via Ignition will be considered at a higher priority than any other method of configuring the Network for a Fedora CoreOS instance. If you specify Networking configuration via Ignition, try not to use other mechanisms to configure the network. | ||
|
||
An example https://docs.fedoraproject.org/en-US/fedora-coreos/producing-ign/[Butane] config for the same static networking example that we showed above is: | ||
|
||
NetworkManager |
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.
Adding a .
on the front will make the formatting look nice in antora:
NetworkManager | |
.NetworkManager keyfile |
Also suggested adding keyfile
on the end there.
I would apply this to all other instances in the file.
dns=8.8.8.8; | ||
dns-search= | ||
may-fail=false | ||
method=manual | ||
---- | ||
|
||
NMstate |
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 .
on the front makes the formatting nicer. Also suggest adding YAML:
NMstate | |
.NMstate YAML |
I would apply this to all other instances in the file.
== Host Network Configuration Examples | ||
|
||
In this section we'll go through common examples of setting up different types of networking devices using both dracut kernel arguments as well as NetworkManager keyfiles via Ignition/Butane. | ||
In this section we'll go through common examples of setting up different types of networking devices using dracut kernel arguments, NetworkManager keyfiles and nmstate via Ignition/Butane. |
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.
In this section we'll go through common examples of setting up different types of networking devices using dracut kernel arguments, NetworkManager keyfiles and nmstate via Ignition/Butane. | |
In this section we'll go through common examples of setting up different types of networking devices using dracut kernel arguments, NetworkManager keyfiles and NMstate via Ignition/Butane. |
dhcp-hostname=myhostname | ||
dns=8.8.8.8; | ||
dns-search= | ||
may-fail=false | ||
method=manual | ||
---- | ||
|
||
==== Butane Nmstate config |
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.
==== Butane Nmstate config | |
==== Butane NMstate YAML config |
If we make this change then apply everywhere else too
@@ -244,7 +275,7 @@ ip=${ip}::${gateway}:${netmask}:${hostname}:${interface}:none:${nameserver} | |||
ip=10.10.10.10::10.10.10.1:255.255.255.0:myhostname:ens2:none:8.8.8.8 | |||
---- | |||
|
|||
==== Butane config | |||
==== Butane NetworkManager config |
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.
To make it a little more clear:
==== Butane NetworkManager config | |
==== Butane NetworkManager keyfile config |
If we make this change then apply everywhere else too
Now that nmstate is part of fcos the network configuration examples
should be extended with it.
Also fixed
10.10.10.1
been listed as IP address in NetworkManager keyfile, it is supposed to be a gateway IP, not IP address of NIC.