-
Notifications
You must be signed in to change notification settings - Fork 303
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
Multi networking support in the L4 ILB controller #2013
Conversation
Hi @mmamczur. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
7954f06
to
d094c18
Compare
d094c18
to
ed16f49
Compare
/ok-to-test |
/hold |
/assign |
ed16f49
to
0555ca6
Compare
0555ca6
to
061c480
Compare
2f2f14d
to
280e0e3
Compare
I've added another PR that has the commits from here but up to changes in the NEG controller only #2023 |
df633ce
to
19a11eb
Compare
71266b9
to
8ae07d2
Compare
8ae07d2
to
d0dce71
Compare
/assign @cezarygerard |
@@ -229,7 +230,7 @@ func createBackendService(t *testing.T, sp utils.ServicePort, backendPool *Backe | |||
t.Helper() | |||
namespacedName := types.NamespacedName{Name: "service.Name", Namespace: "service.Namespace"} | |||
protocol := string(apiv1.ProtocolTCP) | |||
if _, err := backendPool.EnsureL4BackendService(sp.BackendName(), hcLink, protocol, string(apiv1.ServiceAffinityNone), string(cloud.SchemeExternal), namespacedName); err != nil { | |||
if _, err := backendPool.EnsureL4BackendService(sp.BackendName(), hcLink, protocol, string(apiv1.ServiceAffinityNone), string(cloud.SchemeExternal), namespacedName, network.NetworkInfo{IsDefault: true}); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are 6 operations happening in this 1 line
can you create variables for args in EnsureL4BackendService?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracted most of them
@@ -227,6 +237,10 @@ func (l4c *L4Controller) processServiceCreateOrUpdate(service *v1.Service) *load | |||
if err != nil { | |||
return &loadbalancers.L4ILBSyncResult{Error: err} | |||
} | |||
network, err := network.ServiceNetwork(service, l4c.networkLister, l4c.gkeNetworkParamSetLister, l4c.ctx.Cloud, klog.TODO()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you needed to pass the logger there?
looks weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was a request from Swetha in the changes for NEG controller. They have this scoped log there and want to use it in the code they call. This function is shared in both controllers so I now have to pass some logger
@@ -323,3 +396,108 @@ func TestL4EnsureIPv4ForwardingRuleAddressAlreadyInUse(t *testing.T) { | |||
require.Error(t, err) | |||
assert.True(t, utils.IsIPConfigurationError(err)) | |||
} | |||
|
|||
func TestL4EnsureIPv4ForwardingRule(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if creating 2 separate tests would be more readable (instead of table test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the logic changed a bit so that the code always uses the value from network info - no need for 2 cases anymore. I removed the table
d0dce71
to
1255994
Compare
that looks good to me do we need a review from @bowei @swetharepakula OR @aojea ? |
I don't think so, this touches only L4. But everyone is welcome to review |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cezarygerard, mmamczur 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 |
@bowei I am unholding this change /unhold |
This PR contains commits implementing multi networking support for L4 ILBs