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

udn: set persistentIPs for UDN ifaces #4651

Merged
merged 11 commits into from
Sep 12, 2024

Conversation

maiqueb
Copy link
Contributor

@maiqueb maiqueb commented Aug 22, 2024

What this PR does and why is it needed

This PR looks for a special annotation on pods, where KubeVirt (or an agent on behalf of KubeVirt) will indicate what is the name of the IPAMClaim used for the primary UDN interface.

An alternative would be to use an hard-coded value, but then we wouldn't be able to distinguish between a pod and a VM, and we do not want to abuse reading the KubeVirt label.

Which issue(s) this PR fixes

Fixes #

Special notes for reviewers

Pending adding the CI requirements, ensuring kubevirt e2e tests are run.

How to verify it

Details to documentation updates

Description for the changelog

Configure persistent IPs on UDN networks when requested

Does this PR introduce a user-facing change?

Configure persistent IPs on UDN networks when requested

@tssurya tssurya added the feature/user-defined-network-segmentation All PRs related to User defined network segmentation label Aug 22, 2024
@github-actions github-actions bot added area/e2e-testing feature/kubevirt-live-migration All issues related to kubevirt live migration labels Aug 29, 2024
@qinqon qinqon mentioned this pull request Sep 3, 2024
@maiqueb maiqueb marked this pull request as ready for review September 5, 2024 15:54
@maiqueb maiqueb requested a review from a team as a code owner September 5, 2024 15:54
@maiqueb maiqueb force-pushed the udn-persistentips branch 2 times, most recently from 18b8b0f to 6fb32d4 Compare September 6, 2024 10:55
@github-actions github-actions bot added the area/unit-testing Issues related to adding/updating unit tests label Sep 6, 2024
Copy link
Contributor

@jcaamano jcaamano left a comment

Choose a reason for hiding this comment

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

Will we have integration docs for this new annotation?

contrib/kind-common Outdated Show resolved Hide resolved
go-controller/pkg/util/multi_network.go Show resolved Hide resolved
go-controller/pkg/util/pod_annotation.go Outdated Show resolved Hide resolved
go-controller/pkg/util/multi_network.go Outdated Show resolved Hide resolved
test/e2e/kubevirt.go Outdated Show resolved Hide resolved
@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 6, 2024

Will we have integration docs for this new annotation?

Yes. But since we have no documentation about primary UDN, it feels very weird to add it.

Once that exists, I will explain the annotation.

@jcaamano
Copy link
Contributor

jcaamano commented Sep 6, 2024

One other question:

Would it have been theoretically possible to use the ipam claim reference in a network selection element for the default network (instead of this new annotation) leveraging v1.multus-cni.io/default-network annotation. I know that is out of spec but we are out of spec here anyway and we wouldn't need to define new things.

@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 6, 2024

One other question:

Would it have been theoretically possible to use the ipam claim reference in a network selection element for the default network (instead of this new annotation) leveraging v1.multus-cni.io/default-network annotation. I know that is out of spec but we are out of spec here anyway and we wouldn't need to define new things.

Not sure ... how would that play along for the rest of the synthetic network selection element we are using to attach to UDN ? For UDN pods, we'd use the synthetic network-selection-element, for UDN VMs we'd use this explicitly defined network-selection-element ?... We'd merge the synthetic NSE w/ the existing one ?...

Maybe it's me, but it sounds more complex.

@jcaamano
Copy link
Contributor

jcaamano commented Sep 6, 2024

One other question:
Would it have been theoretically possible to use the ipam claim reference in a network selection element for the default network (instead of this new annotation) leveraging v1.multus-cni.io/default-network annotation. I know that is out of spec but we are out of spec here anyway and we wouldn't need to define new things.

Not sure ... how would that play along for the rest of the synthetic network selection element we are using to attach to UDN ? For UDN pods, we'd use the synthetic network-selection-element, for UDN VMs we'd use this explicitly defined network-selection-element ?... We'd merge the synthetic NSE w/ the existing one ?...

Maybe it's me, but it sounds more complex.

I am not sure what's the synthetic network selection element used for, but that looks like an implementation detail.

I would value more having a consistent API for our users.

@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 6, 2024

One other question:
Would it have been theoretically possible to use the ipam claim reference in a network selection element for the default network (instead of this new annotation) leveraging v1.multus-cni.io/default-network annotation. I know that is out of spec but we are out of spec here anyway and we wouldn't need to define new things.

Not sure ... how would that play along for the rest of the synthetic network selection element we are using to attach to UDN ? For UDN pods, we'd use the synthetic network-selection-element, for UDN VMs we'd use this explicitly defined network-selection-element ?... We'd merge the synthetic NSE w/ the existing one ?...
Maybe it's me, but it sounds more complex.

I am not sure what's the synthetic network selection element used for, but that looks like an implementation detail.

I would value more having a consistent API for our users.

It's how we're requesting the UDN interface attachment without persistent IPs.

Meaning, the API is not consistent now. I don't think that can converge in this PR.

@jcaamano
Copy link
Contributor

jcaamano commented Sep 6, 2024

It's how we're requesting the UDN interface attachment without persistent IPs.

But you mean completely internal to OVN-K, we are not using it as an API to interface with any other external component. Or what does synthetic refer to in this context?

Meaning, the API is not consistent now. I don't think that can converge in this PR.

The IPAM claim reference API could be consistent because it would be the same for secondary and primary networks.

Not for this PR, but maybe worth exploring before the final integration.

@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 6, 2024

It's how we're requesting the UDN interface attachment without persistent IPs.

But you mean completely internal to OVN-K, we are not using it as an API to interface with any other external component. Or what does synthetic refer to in this context?

Meaning, the API is not consistent now. I don't think that can converge in this PR.

The IPAM claim reference API could be consistent because it would be the same for secondary and primary networks.

Yes, but, I think that by making that API consistent, you are then making the UDN API inconsistent - if persistent IPs are used, we require a network selection element; if not, we'd just annotate the namespace.

Not for this PR, but maybe worth exploring before the final integration.

This would maybe be an interesting idea to explore in the enhancement proposal.

@jcaamano
Copy link
Contributor

jcaamano commented Sep 6, 2024

Yes, but, I think that by making that API consistent, you are then making the UDN API inconsistent - if persistent IPs are used, we require a network selection element; if not, we'd just annotate the namespace.

The network selection element would not replace the namespace annotation, that is just a shortcut to default a different network in your namespace (so more akin to a shortcut for v1.multus-cni.io/default-network). But if you want to change the details of that network on a pod-per-pod basis, then you would have to annotate the pod with the NSE for the default network as you do today, for example, to use sr-iov on the default network with a specific pod.

@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 9, 2024

The network selection element would not replace the namespace annotation, that is just a shortcut to default a different network in your namespace (so more akin to a shortcut for v1.multus-cni.io/default-network). But if you want to change the details of that network on a pod-per-pod basis, then you would have to annotate the pod with the NSE for the default network as you do today, for example, to use sr-iov on the default network with a specific pod.

Right now, it is impossible to refer to a primary UDN via network-selection-element. We disallow that explicitly in the code. This will need to be discussed, but, I agree it could be a more generic way to extend the primary UDN in a per pod way. SR-IOV and persistent IPs would not be that different - I agree with you.

I think I start to see your point. I will consider this option in the enhancement. Thanks for raising it.

@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 10, 2024

ovn-ci / e2e (kv-live-migration, noHA, shared, dualstack, SnatGW, 1br, ic-single-node-zones, 3

#4709

@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 10, 2024

The upgrade test is flaking on #4481; updated that issue.

@maiqueb maiqueb closed this Sep 10, 2024
@maiqueb maiqueb reopened this Sep 10, 2024
@maiqueb maiqueb force-pushed the udn-persistentips branch 2 times, most recently from cf318ce to 46dc6a0 Compare September 11, 2024 09:41
@qinqon
Copy link
Contributor

qinqon commented Sep 11, 2024

/lgtm

The kubevirt issues were related to #4625

@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 11, 2024

Fixed the errors in the kubevirt lane, introduced after rebasing #4625 (since we were testing a dual stack UDN in an IPv4 cluster) in this forced push.

@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 11, 2024

/lgtm

The kubevirt issues were related to #4625

Thanks for the help !!! 🚀

@maiqueb maiqueb force-pushed the udn-persistentips branch 2 times, most recently from 77e40be to c3f1e7e Compare September 11, 2024 17:16
RamLavi and others added 11 commits September 12, 2024 10:58
When deploying the kind cluster, in order to allow running VMs with
primary-UDN, the kubevirt CR is patched with:
- NetworkBindingPlugins feature gate.
- the passt network binding

Signed-off-by: Ram Lavi <[email protected]>
Co-authored-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Ram Lavi <[email protected]>
Separating two different installations into different functions.
In future commit this will allow deploying kubevirt-ipam separately when
needed.

Signed-off-by: Ram Lavi <[email protected]>
Although they usually deployed together, ipam may sometimes need to be
deployed out of band for dev purposes.
For this purpose, introducing an opt-out flag that will prevent
installing the latest ipam-controller while still installing
cert-manager.

Signed-off-by: Ram Lavi <[email protected]>
Signed-off-by: Miguel Duarte Barroso <[email protected]>
As a bonus add some coverage to the function that generates the syntetic
network selection element we use to request the primary UDN attachment.

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Co-authored-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Enrique Llorente <[email protected]>
@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 12, 2024

@jcaamano jcaamano merged commit 8fae3ea into ovn-org:master Sep 12, 2024
38 of 39 checks passed
@maiqueb maiqueb deleted the udn-persistentips branch September 12, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/e2e-testing area/unit-testing Issues related to adding/updating unit tests feature/kubevirt-live-migration All issues related to kubevirt live migration feature/user-defined-network-segmentation All PRs related to User defined network segmentation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants