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

network: Add link state management section #864

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

Conversation

orelmisan
Copy link
Member

What this PR does / why we need it:
Add documentation for the link state management feature.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note:

NONE

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Jan 21, 2025
@kubevirt-bot kubevirt-bot requested review from EdDev and RamLavi January 21, 2025 07:55
@orelmisan
Copy link
Member Author

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2025
@orelmisan
Copy link
Member Author

/uncc @RamLavi
/cc @ormergi @nirdothan

@kubevirt-bot kubevirt-bot requested review from nirdothan and ormergi and removed request for RamLavi January 21, 2025 07:56
@orelmisan
Copy link
Member Author

Change: Added a disclaimer about setting the primary interface's link state to down when using readiness / liveness probes.

Copy link
Contributor

@nirdothan nirdothan left a comment

Choose a reason for hiding this comment

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

Thanks @orelmisan. Please see my comments below.

## Link State Management

KubeVirt enables setting the desired interface's link state using the interface's `state` field.
The allowed values are: `up`, `down`. Unspecified value is considered as `up`.
Copy link
Contributor

Choose a reason for hiding this comment

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

what about absent

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a note about absent.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is a good observation about a problematic separation.
We have now one field named interface state that through it a user can implement hotplug/unplug and link-state.

We could have organized it under a common "Interface state management" section.
Lets consider this in a follow up.

KubeVirt enables setting the desired interface's link state using the interface's `state` field.
The allowed values are: `up`, `down`. Unspecified value is considered as `up`.

When the desired link state is set to `down`, it is equivalent to having the network cable disconnected from the machine.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: And I'm not even sure that I agree with myself here :) but it might technically be more correct, since the NIC is emulated.

Suggested change
When the desired link state is set to `down`, it is equivalent to having the network cable disconnected from the machine.
When the desired link state is set to `down`, it emulates the effect of disconnecting the network cable from the machine

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed the wording a bit.

pod: { }
```

The desired link state specification could be specified:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The desired link state specification could be specified:
The desired link state specification can be specified:

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

4. When a new network interface is hot-plugged.

> [!NOTE]
> The desired link state could be specified for network interfaces using all bindings other than `sriov`, as the virtualization
Copy link
Contributor

Choose a reason for hiding this comment

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

can

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

> stack used by KubeVirt does not allow setting it for SR-IOV devices.

> [!WARNING]
> When HTTP / TCP readiness and/or liveness probes are specified on the VM, setting the primary interface's link state to `down` will
Copy link
Contributor

Choose a reason for hiding this comment

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

please consider a link to the probes documentation

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how to do it in a way that will not easily break.
@aburdenthehand could you please guide me?

@@ -509,6 +509,75 @@ spec:
> **Note:** Placement on dedicated CPUs can only be achieved if the Kubernetes CPU manager is running on the SR-IOV capable workers.
> For further details please refer to the [dedicated cpu resources documentation](../compute/dedicated-cpu_resources.md/).

## Link State Management
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Link State Management
### Link State Management

As Interfaces are at level ##

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, done.

@orelmisan
Copy link
Member Author

Change: Addressed @nirdothan's comments.

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2025
Copy link
Member

@EdDev EdDev left a comment

Choose a reason for hiding this comment

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

Thank you!

I am looking to re-organize the network documentation to avoid big doc files.
It should not effect this addition, but it better trigger it.

One request: Please mention the version from which this feature is available.

/approve

I am unsure if we can merge this before the v1.5 release, we need to consult over this. (in addition to waiting for the implementation to complete)
/hold

@@ -509,6 +509,78 @@ spec:
> **Note:** Placement on dedicated CPUs can only be achieved if the Kubernetes CPU manager is running on the SR-IOV capable workers.
> For further details please refer to the [dedicated cpu resources documentation](../compute/dedicated-cpu_resources.md/).

### Link State Management
Copy link
Member

Choose a reason for hiding this comment

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

Continuing adding stuff in this file is problematic.

I want to re-organize the documentation we have and start splitting it into smaller pieces.
For now, I do not know what is the correct separation.
So I am good to place it here for now and suggest a better location later.

## Link State Management

KubeVirt enables setting the desired interface's link state using the interface's `state` field.
The allowed values are: `up`, `down`. Unspecified value is considered as `up`.
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a good observation about a problematic separation.
We have now one field named interface state that through it a user can implement hotplug/unplug and link-state.

We could have organized it under a common "Interface state management" section.
Lets consider this in a follow up.

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: EdDev

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

The pull request process is described 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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2025
Add documentation for the link state management feature.

Signed-off-by: Orel Misan <[email protected]>
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2025
@kubevirt-bot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@orelmisan
Copy link
Member Author

Change: Added version number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants