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

Add Dual-Stack support to L4 ILB #1782

Merged
merged 1 commit into from
Oct 21, 2022
Merged

Conversation

panslava
Copy link
Contributor

@panslava panslava commented Aug 19, 2022

Add support for spec.ipFamilies and spec.ipFamiliyPolicy in L4 ILB

  • Add new feature-flag --enable-l4ilb-dual-stack, all the new logic is hidden behind it
  • Support all the transitions between ipFamilies, controller sync will provide resources for required ipFamily and clean resources for not required, but only if they exist in annotations
  • On service deletion, clean up all the resources, no matter if they exist in annotations

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 19, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2022
@k8s-ci-robot
Copy link
Contributor

@panslava: GitHub didn't allow me to assign the following users: czawadka.

Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign czawadka

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.

@panslava
Copy link
Contributor Author

/assign cezarygerard

Copy link
Contributor

@cezarygerard cezarygerard left a comment

Choose a reason for hiding this comment

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

let's discuss some way to slice the l4 struct

pkg/l4lb/l4controller.go Outdated Show resolved Hide resolved
pkg/healthchecks/interfaces.go Outdated Show resolved Hide resolved
pkg/healthchecks/interfaces.go Outdated Show resolved Hide resolved
pkg/healthchecks/healthchecks_l4.go Outdated Show resolved Hide resolved
pkg/healthchecks/interfaces.go Outdated Show resolved Hide resolved
pkg/utils/namer/l4_namer.go Show resolved Hide resolved
pkg/utils/namer/l4_namer.go Show resolved Hide resolved
pkg/utils/utils_test.go Outdated Show resolved Hide resolved
pkg/utils/utils_test.go Show resolved Hide resolved
pkg/loadbalancers/l4_test.go Show resolved Hide resolved
pkg/loadbalancers/forwarding_rules_ipv6.go Show resolved Hide resolved
pkg/loadbalancers/l4.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l4.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l4.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l4.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l4ipv6.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l4_test.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l4_test.go Outdated Show resolved Hide resolved
pkg/utils/ipfamily_test.go Show resolved Hide resolved
pkg/utils/ipfamily_test.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 24, 2022
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 25, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 25, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 26, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 29, 2022
@panslava panslava force-pushed the ilb-ipv6 branch 7 times, most recently from 0a87794 to d95ffea Compare September 1, 2022 13:33
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 30, 2022
@cezarygerard
Copy link
Contributor

Please see my comments

I still didn't review the following packages:

pkg/healthchecksl4
pkg/l4lb
pkg/loadbalancers

pkg/loadbalancers/forwarding_rules_ipv6.go Show resolved Hide resolved
pkg/loadbalancers/forwarding_rules_ipv6.go Show resolved Hide resolved
pkg/utils/namer/l4_namer_test.go Show resolved Hide resolved
pkg/utils/namer/l4_namer_test.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 6, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 7, 2022
@panslava
Copy link
Contributor Author

/hold don't merge to the current release

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 13, 2022
@cezarygerard
Copy link
Contributor

Slavik, we need some unit tests in
pkg/healthchecksl4/healthchecksl4_test.go

pkg/healthchecksl4/healthchecksl4.go Outdated Show resolved Hide resolved
pkg/healthchecksl4/healthchecksl4.go Outdated Show resolved Hide resolved
pkg/healthchecksl4/healthchecksl4.go Show resolved Hide resolved
pkg/l4lb/l4controller_test.go Show resolved Hide resolved
pkg/l4lb/l4controller_test.go Show resolved Hide resolved
pkg/l4lb/l4controller_test.go Show resolved Hide resolved
pkg/loadbalancers/l4ipv6.go Show resolved Hide resolved
pkg/loadbalancers/forwarding_rules_ipv6.go Show resolved Hide resolved
pkg/utils/ipfamily.go Show resolved Hide resolved
pkg/utils/ipfamily_test.go Show resolved Hide resolved
pkg/loadbalancers/l4.go Show resolved Hide resolved
@@ -222,6 +249,7 @@ func (l4 *L4) EnsureInternalLoadBalancer(nodeNames []string, svc *corev1.Service
if err != nil {
klog.Errorf("Failed to lookup existing backend service, ignoring err: %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.

can you move all this code to private method:

	existingBS, err := l4.backendPool.Get(name, meta.VersionGA, l4.scope)
	err = utils.IgnoreHTTPNotFound(err)
	if err != nil {
		klog.Errorf("Failed to lookup existing backend service, ignoring err: %v", err)
	}

	existingFR, err := l4.forwardingRules.Get(l4.GetFRName())
	if existingBS != nil && existingBS.Protocol != string(protocol) {
		klog.Infof("Protocol changed from %q to %q for service %s", existingBS.Protocol, string(protocol), l4.NamespacedName)
		// Delete forwarding rule if it exists
		frName := l4.getFRNameWithProtocol(existingBS.Protocol)
		existingFR, err = l4.forwardingRules.Get(frName)
		if err != nil {
			klog.Errorf("Failed to get forwarding rule %s, err %v", frName, err)
		}
		err = l4.forwardingRules.Delete(frName)
		if err != nil {
			klog.Errorf("Failed to delete forwarding rule %s, err %v", frName, err)
		}

pkg/loadbalancers/l4.go Show resolved Hide resolved
pkg/loadbalancers/l4.go Show resolved Hide resolved
pkg/loadbalancers/l4ipv6.go Show resolved Hide resolved
@panslava panslava force-pushed the ilb-ipv6 branch 5 times, most recently from 4860c87 to 540f956 Compare October 17, 2022 18:53
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 20, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 21, 2022
@cezarygerard
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 21, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cezarygerard, panslava

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:
  • OWNERS [cezarygerard,panslava]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@panslava
Copy link
Contributor Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 21, 2022
@k8s-ci-robot k8s-ci-robot merged commit b8464e6 into kubernetes:master Oct 21, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants