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: Basic layer2 service support #4653

Merged
merged 9 commits into from
Sep 20, 2024
Merged

UDN: Basic layer2 service support #4653

merged 9 commits into from
Sep 20, 2024

Conversation

kyrtapz
Copy link
Contributor

@kyrtapz kyrtapz commented Aug 27, 2024

Adds support for Layer2 services for cluster networked endpoints.
Based on #4567.

@kyrtapz kyrtapz requested a review from a team as a code owner August 27, 2024 08:20
@github-actions github-actions bot added area/unit-testing Issues related to adding/updating unit tests area/e2e-testing feature/egress-service Issues related to egress service feature/services&endpoints All issues related to the Servces/Endpoints API labels Aug 27, 2024
@kyrtapz kyrtapz requested review from ricky-rav and removed request for JacobTanenbaum August 27, 2024 08:20
@kyrtapz kyrtapz force-pushed the l2_pod_svc branch 2 times, most recently from 227ef5b to 7e9a903 Compare August 27, 2024 09:40
@tssurya tssurya added the feature/user-defined-network-segmentation All PRs related to User defined network segmentation label Aug 27, 2024
@kyrtapz kyrtapz force-pushed the l2_pod_svc branch 12 times, most recently from 2eda103 to d37e487 Compare September 2, 2024 14:07
@maiqueb
Copy link
Contributor

maiqueb commented Sep 2, 2024

/cc

@maiqueb maiqueb self-requested a review September 2, 2024 14:54
@kyrtapz kyrtapz force-pushed the l2_pod_svc branch 2 times, most recently from 6278ae9 to 046c09e Compare September 2, 2024 17:23
@github-actions github-actions bot added feature/egress-ip Issues related to EgressIP feature feature/egress-gateway All issues related to ICNI/APBR labels Sep 2, 2024
@kyrtapz kyrtapz force-pushed the l2_pod_svc branch 5 times, most recently from 50f14b4 to 341e8d5 Compare September 17, 2024 11:06
@kyrtapz kyrtapz changed the title [WIP] UDN: Basic layer2 service support UDN: Basic layer2 service support Sep 17, 2024
@kyrtapz kyrtapz force-pushed the l2_pod_svc branch 2 times, most recently from 8c5e740 to 6201f3f Compare September 19, 2024 12:15
@github-actions github-actions bot added the kind/documentation All issues related to documentation label Sep 19, 2024
Copy link
Contributor

@trozet trozet left a comment

Choose a reason for hiding this comment

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

minor nits, lgtm but need to wait on dependent PR

oops forgot about my nat comment, i think that one needs addressing

@@ -631,7 +632,7 @@ func getExternalIPsGR(watchFactory *factory.WatchFactory, nodeName string) ([]*n
// deletePodSNATOps creates ovsdb operation that removes per pod SNAT rules towards the nodeIP that are applied to the GR where the pod resides
// used when disableSNATMultipleGWs=true
func deletePodSNATOps(nbClient libovsdbclient.Client, ops []ovsdb.Operation, gwRouterName string, extIPs, podIPNets []*net.IPNet) ([]ovsdb.Operation, error) {
nats, err := buildPodSNAT(extIPs, podIPNets)
nats, err := buildPodSNAT(extIPs, podIPNets, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

deletePodSNATOps is used by secondary network controller. Why do you pass ""? Looking closer at this,

func isEquivalentNAT(existing *nbdb.NAT, searched *nbdb.NAT) bool {

looks like it is not comparing match criteria. I wonder if that was something missed by the conditional snat update in ovnk?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I modified isEquivalentNAT to take the match into account and fixed the delete path.

@@ -66,7 +67,7 @@ func (cm *NetworkControllerManager) NewNetworkController(nInfo util.NetInfo) (na
case ovntypes.Layer3Topology:
return ovn.NewSecondaryLayer3NetworkController(cnci, nInfo)
case ovntypes.Layer2Topology:
return ovn.NewSecondaryLayer2NetworkController(cnci, nInfo), nil
return ovn.NewSecondaryLayer2NetworkController(cnci, nInfo)
Copy link
Contributor

Choose a reason for hiding this comment

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

on commit "L2 services support" it would be good to have a commit message describing in general what you did to make it work

// kubernetes controller-manager
err := oc.svcController.Run(5, oc.stopChan, runRepair, useLBGroups, oc.svcTemplateSupport)
if err != nil {
klog.Errorf("Error running OVN Kubernetes Services controller: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be good to list the name of the network that the service controller couldn't start for?

Add OVS flows that redirect traffic from the masquerade
subnet towards UDN enabled services to the default gateway router.
For shared gateway mode a static route is added to redirect
the service traffic to the management port. Modified the
staticRouteCleanup to ensure that the new routes are not
getting removed.

Signed-off-by: Patryk Diak <[email protected]>
In case of L2 networks only traffic leaving the cluster
should be SNATed.
Additonally change the order of SNAT cleanup to ensure
that it happens for L2 networks.

Signed-off-by: Patryk Diak <[email protected]>
Run the generic services controller for each primary layer2 network.
It takes care of configuring the load blancers and load balancer groups
for each service in a namespace using the primary layer2 network.

Signed-off-by: Patryk Diak <[email protected]>
This commit does not introduce functional changes.
It makes it possible to add more networks to the
services unit tests.

Signed-off-by: Patryk Diak <[email protected]>
@@ -1033,7 +1033,7 @@ func (oc *SecondaryLayer3NetworkController) StartServiceController(wg *sync.Wait
// kubernetes controller-manager
err := oc.svcController.Run(5, oc.stopChan, runRepair, useLBGroups, oc.svcTemplateSupport)
if err != nil {
klog.Errorf("Error running OVN Kubernetes Services controller: %v", err)
klog.Errorf("Error running OVN Kubernetes Services controller for network %s: %v", oc.GetNetworkName(), err)
Copy link
Contributor

Choose a reason for hiding this comment

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

not really your problem, but i just noticed if we dont start the services controller we just log an error and continue? we should be propagating an error somehow.

Copy link
Contributor

Choose a reason for hiding this comment

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

trozet
trozet previously approved these changes Sep 20, 2024
@kyrtapz kyrtapz dismissed trozet’s stale review September 20, 2024 15:17

The merge-base changed after approval.

@trozet trozet merged commit 9a25bc3 into ovn-org:master Sep 20, 2024
37 of 39 checks passed
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/egress-gateway All issues related to ICNI/APBR feature/egress-ip Issues related to EgressIP feature feature/egress-service Issues related to egress service feature/services&endpoints All issues related to the Servces/Endpoints API feature/user-defined-network-segmentation All PRs related to User defined network segmentation kind/documentation All issues related to documentation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants