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

docs, vm: Add network binding plugins guide #742

Merged
merged 3 commits into from
Dec 17, 2023

Conversation

EdDev
Copy link
Member

@EdDev EdDev commented Dec 3, 2023

Describe the network binding plugins infrastructure for users.
Includes detailed explanation with examples.

The following binding plugins are included:

  • Passt
  • slirp binding plugin

In follow up PRs, the following subject should be covered:

  • Domain Attachement
  • macvtap binding plugin

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Dec 3, 2023
@EdDev
Copy link
Member Author

EdDev commented Dec 3, 2023

/cc @AlonaKaplan

Registration includes the addition of the binding name with all its parameters
to the Kubevirt CR.

The following parameters are currently supported (as of v1.1.1):
Copy link
Member

Choose a reason for hiding this comment

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

I would add this section before the deployment part as an introduction to the binding plugin parts.

I would mention that the binding plugin tries to give a pluggable way to implement each part of the network binding.
plugin CNI -> Pod network configuration.
sidecar or core domain attachment -> Domain vNIC configuration.
sidecar -> Services to deliver network details to the guest (optional).

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 was thinking that we first need to install (deploy) everything before we can register it for usage. Swapping the order is a bit odd.

I would mention that the binding plugin tries to give a pluggable way to implement each part of the network binding.

The intro about the binding plugin is given in the begging of the document, should we add something that is missing there?

plugin CNI -> Pod network configuration.

This is expressed on line 60, I am confused on what would you want to change.

sidecar or core domain attachment -> Domain vNIC configuration.
sidecar -> Services to deliver network details to the guest (optional).

I am not sure where I need to change something.

Copy link
Member

Choose a reason for hiding this comment

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

I wanted the supported parameters to be also in the Network Binding introduction part. But now I re-read, it is fine to keep it here.
But I would expect a more detailed explanation about each one of the parameters.
For example networkAttachmentDefinition: Pointing to a namespace and object name. - what is this NAD. It is the NAD of what CNI? When this CNI will be invoked? What happen if it is empty? What are the special requirements when setting the NAD here? (multus).

Also, in the introduction part you are talking about the binding parts -

The network binding includes:
- Domain vNIC configuration.
- Pod network configuration (optional).
- Services to deliver network details to the guest (optional).

I would add here to which part each parameter is related.

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

docs/virtual_machines/network_binding_plugins.md Outdated Show resolved Hide resolved
"binding": {
"passt": {
"networkAttachmentDefinition": "default/netbindingpasst",
"sidecarImage": "registry:5000/kubevirt/network-passt-binding:devel"
Copy link
Member

Choose a reason for hiding this comment

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

same here, please use a place holder. "registry:5000" feels wrong 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.

Done

terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: registry:5000/kubevirt/fedora-with-test-tooling-container-disk:devel
Copy link
Member

Choose a reason for hiding this comment

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

Please don't use registry:5000. Maybe docker.io/kubevirt/fedora-cloud-container-disk-demo:latestas used in the main interface doc.

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

terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: registry:5000/kubevirt/fedora-with-test-tooling-container-disk:devel
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the registry:5000.

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

"binding": {
"passt": {
"networkAttachmentDefinition": "default/netbindingpasst",
"sidecarImage": "registry:5000/kubevirt/network-passt-binding:devel"
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the registry:5000.

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

Registration includes the addition of the binding name with all its parameters
to the Kubevirt CR.

The following parameters are currently supported (as of v1.1.1):
Copy link
Member

Choose a reason for hiding this comment

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

I wanted the supported parameters to be also in the Network Binding introduction part. But now I re-read, it is fine to keep it here.
But I would expect a more detailed explanation about each one of the parameters.
For example networkAttachmentDefinition: Pointing to a namespace and object name. - what is this NAD. It is the NAD of what CNI? When this CNI will be invoked? What happen if it is empty? What are the special requirements when setting the NAD here? (multus).

Also, in the introduction part you are talking about the binding parts -

The network binding includes:
- Domain vNIC configuration.
- Pod network configuration (optional).
- Services to deliver network details to the guest (optional).

I would add here to which part each parameter is related.

- name: slirpnet
binding:
name: slirp
ports:
Copy link
Member

Choose a reason for hiding this comment

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

I would removed the ports from all the examples.

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

Registration includes the addition of the binding name with all its parameters
to the Kubevirt CR.

The following parameters are currently supported (as of v1.1.1):
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

- name: slirpnet
binding:
name: slirp
ports:
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

}}]'
```

### VM Passt Network Interface
Copy link
Member Author

Choose a reason for hiding this comment

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

Slirp

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

@EdDev
Copy link
Member Author

EdDev commented Dec 7, 2023

change: Answered review comments.

that defines the CNI plugin and the configuration the binding plugin uses.
Used when the binding plugin needs to change the pod network namespace.
- sidecarImage: Specify a container image in a registry.
Used when the binding plugin needs to configure the domain vNIC configuration
Copy link
Member

Choose a reason for hiding this comment

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

configure/modify

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

Copy link
Member

Choose a reason for hiding this comment

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

I meant both should be used "configure/modify".
In no domain attachment is used then the sidecars configures the domain vnic.
If it is used, then it modifies.

docs/virtual_machines/network_binding_plugins.md Outdated Show resolved Hide resolved
- name: passtnet
binding:
name: passt
ports:
Copy link
Member

Choose a reason for hiding this comment

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

please remove the ports.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the passt specific example, I think we want to express it is supported. No?

Copy link
Member

Choose a reason for hiding this comment

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

If we want to express it, we need a separate section that explains it.

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 do not think it exists at the moment.
I suggest to add it, perhaps for other supported fields in a follow up.

to the Kubevirt CR.

The following (optional) parameters are currently supported (as of v1.1.1):
- networkAttachmentDefinition: Use the <namespace/object-name> format to specify
Copy link
Member

Choose a reason for hiding this comment

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

Please mention it requires multus.

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 have added it to the deployment section where it is more relevant.

@EdDev
Copy link
Member Author

EdDev commented Dec 10, 2023

change: Answered review comments.


## Passt network binding plugin

[Plug A Simple Socket Transport](https://passt.top/passt/about/) is an enhanced
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering, if this is replacing the original passt impl. Does it replace the original doc as well?
If so, we need to copy its content here. e.g comparison between binding, restrictions, etc.

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

@EdDev
Copy link
Member Author

EdDev commented Dec 10, 2023

TODO:

  • Copy passt explanation from the current interfaces-and-networks section.
  • Structure files (file for binding plugins, and individual ones for each plugin).
  • Mention passt deprecation.

@EdDev EdDev force-pushed the network-binding-plugin branch 2 times, most recently from 9152fa2 to 283236b Compare December 13, 2023 16:14
@EdDev
Copy link
Member Author

EdDev commented Dec 13, 2023

change: Completed the action items per the previous review.

* Copy `passt` explanation from the current interfaces-and-networks section.

* Structure files (file for binding plugins, and individual ones for each plugin).

* Mention passt deprecation.

@@ -10,6 +10,7 @@ nav:
- numa.md
- disks_and_volumes.md
- interfaces_and_networks.md
- Network Binding Plugins: net_binding_plugins
Copy link
Member

Choose a reason for hiding this comment

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

Please move it to the end of the menu. It is now breaking the otherwise flat menu in half:

image

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

Copy link
Member

Choose a reason for hiding this comment

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

binding
I think that passt and slirp should be in the tree.

@@ -0,0 +1,2 @@
nav:
- network_binding_plugins.md
Copy link
Member

Choose a reason for hiding this comment

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

Add the two plugins to the list so they appear in the menu

Copy link
Member Author

Choose a reason for hiding this comment

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

They are accessible from the main one. Exposing the list from the main menu is a bit "heavy" IMO.
But if you think it looks better, I do not mind.

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 it would be better for visibility. But if you'd rather keep them hidden from the menu, then we should change the configuration so "Network Binding Plugins" does not appear as its own section. If you decide for the latter, then I think you would need to go back to the previous version without .pages in the subdirectory and use net_binding_plugins/passt.md as the link (can't find a doc reference to confirm that that works ATM)

Copy link
Member Author

Choose a reason for hiding this comment

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

then I think you would need to go back to the previous version without .pages in the subdirectory and use net_binding_plugins/passt.md as the link (can't find a doc reference to confirm that that works ATM)

That is what I had and it did not work.

Copy link
Member

Choose a reason for hiding this comment

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

The one I saw you had it set to
image

have you tried setting it without the leading ./?

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 tried that, it did not work.
I ended up with the main file outside and all the specific plugins in the folder.
Hope this is ok with you.

Done.

needs.

These layers include:
- Host connectivity: Network provider.
Copy link
Member

Choose a reason for hiding this comment

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

You must add an empty line above each list. Check the rendered page to make sure that everything shows up as expected

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh... it is not like the markdown rendering.

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

@EdDev EdDev force-pushed the network-binding-plugin branch 3 times, most recently from 666e16e to fbd664d Compare December 13, 2023 18:57
Describe the network binding plugins infrastructure for users.
Includes detailed explanation with examples.

Signed-off-by: Edward Haas <edwardh@redhat.com>
Signed-off-by: Edward Haas <edwardh@redhat.com>
Signed-off-by: Edward Haas <edwardh@redhat.com>
@AlonaKaplan
Copy link
Member

/approve

Although I think that passt and slirp bindings should be in the tree and not just links in the main doc.

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlonaKaplan

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 Dec 14, 2023
@AlonaKaplan
Copy link
Member

/lgtm
all Petr's comment were fixed.

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 17, 2023
@kubevirt-bot kubevirt-bot merged commit 2d5d6cf into kubevirt:main Dec 17, 2023
6 checks passed
- Passt CNI plugin.
- Sidecar image.

As described in the [definition & flow](#definition--flow) section,
Copy link
Contributor

Choose a reason for hiding this comment

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

@EdDev What is this meant to link to? I can't seem to find a related heading in any of our docs

Copy link
Member Author

Choose a reason for hiding this comment

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

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: #793

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. lgtm Indicates that a PR is ready to be merged. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants