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
Prepare for GCP IPAM #10691
Merged
Merged
Prepare for GCP IPAM #10691
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tgraf
added
wip
release-note/misc
This PR makes changes that have no direct user impact.
sig/ipam
IP address management, including cloud IPAM
labels
Mar 24, 2020
tgraf
force-pushed
the
pr/tgraf/gcp-ipam-prep
branch
2 times, most recently
from
March 25, 2020 08:34
90a5883
to
4b760a4
Compare
Move code to iterate over interfaces and addresses into the InstanceMap. This allows to defer deep copying until it is really necessary. This also allows to move the logic to reserve IPs of all interfaces of all instances into the generic GroupPoolAllocator for reuse in future IPAM code. Signed-off-by: Thomas Graf <thomas@cilium.io>
Fixes: ``` WARNING: DATA RACE Read at 0x00c0001b48c0 by goroutine 37: github.com/cilium/cilium/pkg/ipam.(*nodeOperationsMock).PrepareIPAllocation() /home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node_manager_test.go:103 +0x1c5 github.com/cilium/cilium/pkg/ipam.(*Node).determineMaintenanceAction() /home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:492 +0x184 github.com/cilium/cilium/pkg/ipam.(*Node).maintainIPPool() /home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:528 +0x53 github.com/cilium/cilium/pkg/ipam.(*Node).MaintainIPPool() /home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:613 +0x69 github.com/cilium/cilium/pkg/ipam.(*NodeManager).Update.func1() /home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node_manager.go:205 +0x8b github.com/cilium/cilium/pkg/trigger.(*Trigger).waiter() /home/vagrant/go/src/github.com/cilium/cilium/pkg/trigger/trigger.go:206 +0x4b9 Previous write at 0x00c0001b48c0 by goroutine 35: github.com/cilium/cilium/pkg/ipam.(*nodeOperationsMock).AllocateIPs() /home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node_manager_test.go:111 +0x117 github.com/cilium/cilium/pkg/ipam.(*Node).maintainIPPool() /home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:564 +0xa0d github.com/cilium/cilium/pkg/ipam.(*Node).MaintainIPPool() /home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:613 +0x69 github.com/cilium/cilium/pkg/ipam.(*NodeManager).Update.func1() /home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node_manager.go:205 +0x8b github.com/cilium/cilium/pkg/trigger.(*Trigger).waiter() /home/vagrant/go/src/github.com/cilium/cilium/pkg/trigger/trigger.go:206 +0x4b9 ``` Signed-off-by: Thomas Graf <thomas@cilium.io>
Don't hold any locks when calling into IPAM specific operations. Use node.mutex exclusively to protect data access and keep locking periods as short as possible. Signed-off-by: Thomas Graf <thomas@cilium.io>
This removes the need to track the CiliumNode resource in the Azure specific code entirely. Signed-off-by: Thomas Graf <thomas@cilium.io>
There is no point in attempting recalculation of required addresses unless the resource has been attached. Signed-off-by: Thomas Graf <thomas@cilium.io>
Ideally, the pool ID is known. If not known, the list of pools can be searched to identify the correct pool. Signed-off-by: Thomas Graf <thomas@cilium.io>
Signed-off-by: Thomas Graf <thomas@cilium.io>
Signed-off-by: Thomas Graf <thomas@cilium.io>
tgraf
force-pushed
the
pr/tgraf/gcp-ipam-prep
branch
from
March 25, 2020 13:44
4b760a4
to
71f1000
Compare
Signed-off-by: Thomas Graf <thomas@cilium.io>
test-me-please
|
test-me-please |
errordeveloper
approved these changes
Mar 26, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
release-note/misc
This PR makes changes that have no direct user impact.
sig/ipam
IP address management, including cloud IPAM
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.