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

Re-implemented DLB cleanup in nsx-operator #408

Merged
merged 12 commits into from
Feb 4, 2024

Conversation

zhengxiexie
Copy link
Contributor

Delete DLB resources.
The size of load balancer service can be, SMALL, MEDIUM, LARGE, XLARGE, or DLB. The first four sizes are realized on Edge node as a centralized load balancer. DLB is realized on each ESXi hypervisor as a distributed load balancer. Previously, this cleanup function was implemented in NCP nsx_policy_cleanup.py. Now, it is re-implemented in nsx-operator pkg/clean/.

pkg/clean/clean_dlb.go Outdated Show resolved Hide resolved
pkg/clean/clean_dlb.go Outdated Show resolved Hide resolved
@zhengxiexie zhengxiexie force-pushed the clean_dlb_vpc_dev branch 3 times, most recently from 99abc5f to 67721f2 Compare November 28, 2023 06:08
pkg/clean/clean_dlb.go Outdated Show resolved Hide resolved
pkg/clean/clean_dlb.go Outdated Show resolved Hide resolved
pkg/clean/clean_dlb.go Outdated Show resolved Hide resolved
pkg/clean/clean_dlb.go Outdated Show resolved Hide resolved
pkg/clean/clean_dlb.go Outdated Show resolved Hide resolved
zhengxiexie and others added 11 commits February 2, 2024 11:47
Extract interface Comparable, and only need to implement methods in sub-resource.
Sync main branch to vpc_dev to keep both branches consistency.
This is base point for future vpc_dev code rebase back to main branch.
Create the common method used by other modules. When using gomonkey to test the method, encounter the problem that
the mocked method doesn't take effect, fix it by adding -gcflags=all=-l option to prohibit inline optimization.
Refactor the name convention.
Add subnet/subnetset controller to reconcile subnet/subnetset CRD. And
add subnet service to perform NSX subnet CRUD operations.
Default nsx-operator reloads user/name/ca from file. Support to pass
user/pass/ca from parameter
Add cleanup for ippool and subnet as securitypolicy does.
We hold these truths to be self-evident:
log.info -> info, log.v(1).info -> debug, log.error-> error, log.v(2).info-> develop level log

If config.Debug=true, then loglevel=1, if command is passed in loglevel and greater than debug loglevel,
then the loglevel is overridden.
Use another log in config.go.
1. Should delete subnet and subnetset, ListSubnetID should get them all.
2. Since ippool and staticroute rely on vpcService of serviceMediator,
   init vpc first, otherwise, it would report nil pointer when deleting
   ippool or staticroute.
@zhengxiexie zhengxiexie changed the base branch from vpc_dev to main February 2, 2024 04:09
@zhengxiexie zhengxiexie force-pushed the clean_dlb_vpc_dev branch 5 times, most recently from 2ee0789 to 54879db Compare February 2, 2024 05:07
@zhengxiexie zhengxiexie force-pushed the clean_dlb_vpc_dev branch 4 times, most recently from 283c1b3 to 15859e5 Compare February 2, 2024 10:11
@zhengxiexie
Copy link
Contributor Author

/e2e

Delete DLB resources.
The size of load balancer service can be, SMALL, MEDIUM, LARGE, XLARGE, or DLB.
The first four sizes are realized on Edge node as a
centralized load balancer. DLB is realized on each ESXi hypervisor as a distributed load balancer.
Previously, this cleanup function was implemented in NCP nsx_policy_cleanup.py.
Now, it is re-implemented in nsx-operator pkg/clean/.

Signed-off-by: Xie Zheng <xizheng@vmware.com>
@zhengxiexie
Copy link
Contributor Author

/e2e

@zhengxiexie zhengxiexie merged commit 924cc34 into vmware-tanzu:main Feb 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants