Skip to content

OPNET-592: Install-config interface for NMState configuration #1795

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cybertron
Copy link
Member

No description provided.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 9, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 9, 2025

@cybertron: This pull request references OPNET-592 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "4.20.0" version, but no target version was set.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from danwinship and trozet May 9, 2025 16:23
Copy link
Contributor

openshift-ci bot commented May 9, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign abhat for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

openshift-ci bot commented May 9, 2025

@cybertron: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/markdownlint c5b5fdb link true /test markdownlint

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

- 172.30.0.0/16
# New part begins here
hostConfig:
- name: master-0
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the role of the name in this interface? Is it used to make a decision which configuration is applied to which node, or is it purely about labelling?

There are 2 cases where it may or may not matter

  1. Bare metal clusters where you may not be sure if your network infra dispatches hostnames correctly (see wrong DHCP, missing PTRs and so on). If we match config for the NIC by its MAC address then it's cool because we don't really need a name for the host. At the same time, if you manage a cluster of metal nodes, you should have an inventory of MAC addresses, otherwise you have other, bigger, problems.

  2. Non-metal platforms with machines dynamically created. Given the interface is now platform-agnostic, it is possible for someone to use it on e.g. AWS-deployed cluster. That means, at the moment of generating install-config you do not know names of the hosts; you also do not know MAC addresses of the NICs you are going to get on those nodes. Maybe this is a non-goal at this moment, but imagine a following scenario

As an operator deploying on AWS/Azure nodes with 2 NICs, I want the 2nd NIC of every node to be configured with a static IPv4 address in the form of 172.16.0.x/24 for x in 1-10.

We may or may not allow this, but interface in its current form looks like a perfect candidate to fulfil such a story.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a mapping of configs to nodes. Currently the underlying feature only supports hostnames, but we could definitely look at supporting MACs too. I don't think the design proposed here would be incompatible with that - you'd just specify a MAC address instead of the hostname to identify the node.

For the purposes of platforms like cloud where you don't know either the hostname or MAC ahead of time, there are a couple of mitigating factors:

  1. Those are the least likely platforms to want this functionality because they tend to have less complex networking (I know that's not universally true, but in general it is).
  2. We don't support per-host configuration on those platforms today, and they can still use the cluster.yml configuration to provide a cluster-wide configuration if they so desire.

Copy link
Member

Choose a reason for hiding this comment

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

MachineConfigs don't support selecting individual nodes. Is this doing some sort of runtime selection like ABI/Assisted?

ABI/Assisted and NNCP both use a list of interface MACs to select nodes, it would be nice to keep that consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

We're currently using hostname, but adding MAC-based mapping makes a lot of sense too. I don't think anything about this design precludes having different identifiers in the future. Anything unique to a specific node should work.

@mkowalski
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 21, 2025
Comment on lines +68 to +71
complementary. The baremetal feature can be used to configure, for
example, a static IP on the primary interface to allow Ignition to be
pulled, then this feature can be used to do full configuration on the
node.
Copy link
Contributor

Choose a reason for hiding this comment

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

We also need to consider agent installer, which if IIUC exposes complete nmstate configuration: https://github.com/openshift/assisted-service/blob/master/api/v1beta1/nmstate_config_types.go

Looping in @andfasano & @zaneb

Copy link
Member

Choose a reason for hiding this comment

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

baremetal platform and ABI usage is similar. They're both used for pre-provisioning configuration (i.e. before the host becomes a node) but then also copied into the node.

Comment on lines +68 to +71
complementary. The baremetal feature can be used to configure, for
example, a static IP on the primary interface to allow Ignition to be
pulled, then this feature can be used to do full configuration on the
node.
Copy link
Member

Choose a reason for hiding this comment

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

baremetal platform and ABI usage is similar. They're both used for pre-provisioning configuration (i.e. before the host becomes a node) but then also copied into the node.


Add a new field to the networking section of install-config that allows
users to provide their NMState config for cluster nodes. This will look
something like the networkConfig field for the baremetal platform, but
Copy link
Member

Choose a reason for hiding this comment

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

If only one is specified, will the other default to that? In both directions or only one direction? If the latter, which?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, in this case it's not possible for the same config to be used for both steps. At Ignition pull time we can't have br-ex because OVS isn't running yet, so that initial config has to be different from the final one.


A user will write an appropriate NMState config for their network environment
and include that in their install-config. The NMState YAML they provide will
then be base64-encoded and placed in a machine-config manifest that will be
Copy link
Member

Choose a reason for hiding this comment

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

Is it time to reopen the NNCP debate?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would streamline a lot of our day one configuration. In this case we already have the feature and it's being used so putting a nicer interface on it is probably necessary whether we get NNCP integration for day one or not, but that's definitely a conversation we need to revisit.

- 172.30.0.0/16
# New part begins here
hostConfig:
- name: master-0
Copy link
Member

Choose a reason for hiding this comment

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

MachineConfigs don't support selecting individual nodes. Is this doing some sort of runtime selection like ABI/Assisted?

ABI/Assisted and NNCP both use a list of interface MACs to select nodes, it would be nice to keep that consistent.

networkConfig:
interfaces:
- type: ethernet
name: eth0
Copy link
Member

Choose a reason for hiding this comment

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

ABI/Assisted both have a feature where the interface name gets substituted at runtime based on the matching the MAC to a real interface. I guess the thinking here is that this is no longer required because NMState supports it directly? (And hopefully one day will allow VLANs on top?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I don't want to implement something OpenShift-specific when NMState already has most of what we need, and the remaining bits are doable on their side.

```

The content of the networkConfig fields will be used as input to the
configure-ovs-alternative feature.
Copy link
Member

Choose a reason for hiding this comment

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

Are we expecting the OVS bridge configuration itself to be modifiable through this mechanism?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes and no. Right now this is a one-time-only configuration and can't be used on day two to modify things (the NMState config needs to be copied to Kubernetes NMState for day two). However, with Kubernetes-NMState you are allowed to make limited modifications to br-ex. We're also investigating reusing this mechanism to make more disruptive changes that would require a reboot: https://issues.redhat.com/browse/OPNET-594


All of this configuration can already be achieved by writing nmconnection
files to the nodes anyway. This is actually a slight improvement in that
NMState will validate syntax before applying changes and will roll back
Copy link
Member

Choose a reason for hiding this comment

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

We can't validate this well in the installer, so the reality is that bad syntax will result in the config being more or less silently ignored.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we can't validate it early, but it will cause a failure at deploy-time for the node, and hopefully leave you with a functional network configuration (albeit without br-ex) so at least you can get on the node to debug easily.

new virtualization customers will have limited experience with advanced
host network configuration and want to make the experience as smooth as
possible. While the existing machine-config interface is functional, it
requires manual creation of base64-encoded content and machine-config
Copy link
Member

Choose a reason for hiding this comment

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

Butane allows defining data inline, and can be processed into a MachineConfig (many examples of this in the OpenShift docs), so it's not quite this dire.

name: eth0
...
- name: master-1
networkConfig:
Copy link
Member

Choose a reason for hiding this comment

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

Assisted (but not ABI) already has plans for NMPolicy support. Would we consider that valid here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe so. Anything you can apply with the nmstate service on the node (the built-in one from RHEL, not the nmstate-configuration service we add from OCP to map these configs). In fact, I'm pretty sure at least one existing user of this feature is using policy-based configurations because they have a separate way of tagging interfaces for their intended use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants