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

Implement garbage collector for IP Pools #3672

Merged
merged 1 commit into from May 5, 2022
Merged

Conversation

annakhm
Copy link
Contributor

@annakhm annakhm commented Apr 20, 2022

A periodic task would go over all IP Pools and clean up
all allocations and reservations for which owner no longer
exists in k8s.

Signed-off-by: Anna Khmelnitsky akhmelnitsky@vmware.com

@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2022

Codecov Report

Merging #3672 (df80c2d) into main (ba8210c) will increase coverage by 1.27%.
The diff coverage is 84.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3672      +/-   ##
==========================================
+ Coverage   63.56%   64.84%   +1.27%     
==========================================
  Files         278      278              
  Lines       39360    39547     +187     
==========================================
+ Hits        25020    25643     +623     
+ Misses      12420    11917     -503     
- Partials     1920     1987      +67     
Flag Coverage Δ
e2e-tests 50.10% <22.22%> (?)
kind-e2e-tests 52.19% <22.22%> (+1.39%) ⬆️
unit-tests 43.84% <84.44%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/controller/ipam/antrea_ipam_controller.go 76.52% <84.44%> (-2.56%) ⬇️
pkg/agent/nodeportlocal/k8s/annotations.go 84.44% <0.00%> (-15.56%) ⬇️
pkg/apiserver/handlers/endpoint/handler.go 56.52% <0.00%> (-13.05%) ⬇️
pkg/agent/flowexporter/connections/connections.go 75.75% <0.00%> (-2.27%) ⬇️
pkg/agent/nodeportlocal/k8s/npl_controller.go 61.21% <0.00%> (-1.87%) ⬇️
pkg/ovs/openflow/ofctrl_builder.go 58.20% <0.00%> (-1.48%) ⬇️
pkg/agent/openflow/pipeline.go 74.16% <0.00%> (-1.21%) ⬇️
pkg/util/k8s/node.go 87.62% <0.00%> (-1.04%) ⬇️
pkg/agent/openflow/network_policy.go 84.88% <0.00%> (-1.03%) ⬇️
... and 53 more

@annakhm annakhm marked this pull request as draft April 20, 2022 23:01
@annakhm annakhm marked this pull request as ready for review April 21, 2022 01:15
@annakhm
Copy link
Contributor Author

annakhm commented Apr 21, 2022

/test-e2e

@annakhm
Copy link
Contributor Author

annakhm commented Apr 21, 2022

/test-flexible-ipam-e2e

@annakhm
Copy link
Contributor Author

annakhm commented Apr 25, 2022

/test-e2e

@annakhm
Copy link
Contributor Author

annakhm commented Apr 25, 2022

I think garbage collector interval should be increased (1 min in this PR), would appreciate feedback.

Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

LGTM.

I think we can do every 10 mins.

@gran-vmv
Copy link
Contributor

LGTM.

I think we can do every 10 mins.

Agree with Jianjun. 10min is OK.

@annakhm
Copy link
Contributor Author

annakhm commented Apr 26, 2022

LGTM.
I think we can do every 10 mins.

Agree with Jianjun. 10min is OK.

Thank you, increased to 10min.

gran-vmv
gran-vmv previously approved these changes Apr 26, 2022
jianjuns
jianjuns previously approved these changes Apr 27, 2022
tnqn
tnqn previously approved these changes Apr 28, 2022
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@tnqn
Copy link
Member

tnqn commented Apr 28, 2022

/test-all
/test-flexible-ipam-e2e

@jianjuns
Copy link
Contributor

@annakhm there is a unit test failure.

@annakhm
Copy link
Contributor Author

annakhm commented Apr 29, 2022

@annakhm there is a unit test failure.

Thanks @jianjuns, hopefully fixed now

@tnqn
Copy link
Member

tnqn commented Apr 29, 2022

--- FAIL: TestReleaseStaleAddresses (0.20s)
    antrea_ipam_controller_test.go:261: IP Pool status: [{10.2.2.12 Reserved {<nil> 0xc0005a0d80}} {20.2.2.13 Reserved {<nil> 0xc0005a0db0}} {20.2.2.14 Reserved {<nil> 0xc0005a0de0}} {20.2.2.15 Allocated {0xc00030f240 0xc0005a0e10}}]
    testing.go:1152: race detected during execution of test

@annakhm
Copy link
Contributor Author

annakhm commented Apr 29, 2022

/test-all

@annakhm
Copy link
Contributor Author

annakhm commented Apr 29, 2022

/test-e2e

@annakhm
Copy link
Contributor Author

annakhm commented May 2, 2022

/test-all

A periodic task would go over all IP Pools and clean up
all allocations and reservations for which owner no longer
exists in k8s.

Signed-off-by: Anna Khmelnitsky <akhmelnitsky@vmware.com>
@annakhm
Copy link
Contributor Author

annakhm commented May 3, 2022

/test-e2e

@annakhm
Copy link
Contributor Author

annakhm commented May 3, 2022

/test-flexible-ipam-e2e

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@tnqn
Copy link
Member

tnqn commented May 5, 2022

/test-conformance
/test-networkpolicy
/skip-e2e which already succeeded

@tnqn tnqn added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. action/release-note Indicates a PR that should be included in release notes. labels May 5, 2022
@tnqn tnqn merged commit 09d11e9 into antrea-io:main May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants