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

Prefix Delegation: Merge from prefix delegation preview branch to master #1516

Merged
merged 19 commits into from
Jun 24, 2021

Conversation

jayanthvn
Copy link
Contributor

What type of PR is this?
feature

Which issue does this PR fix:
This is an enhancement to achieve higher pod density per node.

What does this PR do / Why do we need it:
Current implementation allocates secondary IPs per ENI which will be used for pod IPs. With the new VPC feature each secondary IP will be replaced with /28 prefix in the ENI's subnet. IPs will be allocated from this subnet.

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:
N/A

Testing done on this change:

Yes

Automation added to e2e:

Yes

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
New feature so downgrades won't be supported.

Does this change require updates to the CNI daemonset config files to work?:

Yes

ENABLE_PREFIX_DELEGATION to enable the feature
WARM_PREFIX_TARGET to allocate /28 prefixes and store in warm pool.

Does this PR introduce any user-facing change?:

Yes, scale per node will increase and max pods per node needs to be updated.

Prefix delegation feature to support higher pod density per node.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

* ENABLE_PREFIX_DELEGATION knob

WARM_PREFIX_TARGET knob

cr https://code.amazon.com/reviews/CR-40610031

* PD changes - dev only

* Cooldown prefix IP

* minor fixes to support prefix count

* Code cleanup

* Handle few corner cases

* Nitro based check

* With custom networking, do not get prefix for primary ENI

* Code refactor

* Handle graceful upgrade/enable PD from disable PD

* code refactoring

* Code refactoring

* fix computing too low IPs

* UT for prefix store

* Fix UTs and handle CR comments

* Clean up SDK code and fix model code generation

* fix format and merge induced error

* Merge broke the code

* Fix Dockerfile.test

* Added IPAMD UTs and fixed removeENI total count

* Couple more IPAMD UTs for PD

* UTs for awsutils/imds

* Handle graceful PD enable to disable knob

* get prefix list for non-pd case

* Prevent reconcile of prefix IPs in IP datastore

* Handle disable scenario

* fix formatting

* clean up comment

* Remove unnecessary debugs

* Handle PR comments

* formatting fix

* Remodelled PD datastore

* Fix up UTs and fix Prefix nil

* formatting

* PR comments - minor cosmetic changes

* removed the sdk override from makefile

* Internal repo merge added these lines

* Update config file

* Handle wrapper of DescribeNetworkInterfacesWithContext to take one eni

* RemoveUnusedENIFromStore was not accounting for prefixes deleted

* Removed hardcoding of 16
…ore of CIDRs (aws#1471)

* Code refactor - merge to single DB

* remove few debugs

* remove prefix store files

* PR comments

* Fix up CR comments

* formatting

* Updated UT cases

* UT and formatting

* Minor fixes

* Minor comments

* Updated /32 store term

* remove unused code
* Multi-pd and WARM targets support

* cleanup

* Updated variable names

* Default prefix count to -1

* Get stats should be computed on the fly since CIDR pool can have /32 or /28

* Support for warm prefix 0

* code review comments
* Traffic test case and readme update

* Added testcases for warm ip/min ip with PD

* Testcases for prefix count

* Testcase for warm prefix along with warm ip/min ip

* Updated traffic test case while PD mode is flipped

* Fix minor comments

* pr comments

* added pods per eni

* fix up count
* Support mixed instances with PD

* fix up the log
* optimization for prefixes

Prefix store optimization

* pr comment
* Fixup eni allocation with warm targets

* fixup cidr count

* code comments and warm prefix 0
* Handle prefix target 0

* pr commets
@jayanthvn jayanthvn self-assigned this Jun 18, 2021
@jayanthvn jayanthvn added this to the v1.9.0 milestone Jun 18, 2021
@jayanthvn
Copy link
Contributor Author

locally UTs are running fine and even build is good -

PASS
coverage: 100.0% of statements
ok  	github.com/aws/amazon-vpc-cni-k8s/pkg/utils/retry	0.002s	coverage: 100.0% of statements
?   	github.com/aws/amazon-vpc-cni-k8s/pkg/utils/ttime	[no test files]
?   	github.com/aws/amazon-vpc-cni-k8s/pkg/utils/ttime/mocks	[no test files]

 % [amazon-vpc-cni-k8s]
dev-dsk-varavaj-2b-72f02457 % make build-linux
go build -mod=mod -buildmode=pie -ldflags '-s -w -X main.version=v1.6.4-rc1-171-gd0f990ea -X pkg/awsutils/awssession.version=v1.6.4-rc1-171-gd0f990ea' -o aws-k8s-agent     ./cmd/aws-k8s-agent
# github.com/aws/amazon-vpc-cni-k8s/cmd/aws-k8s-agent
loadinternal: cannot find runtime/cgo
go build -mod=mod -buildmode=pie -ldflags '-s -w -X main.version=v1.6.4-rc1-171-gd0f990ea -X pkg/awsutils/awssession.version=v1.6.4-rc1-171-gd0f990ea' -o aws-cni           ./cmd/routed-eni-cni-plugin
# github.com/aws/amazon-vpc-cni-k8s/cmd/routed-eni-cni-plugin
loadinternal: cannot find runtime/cgo
go build -mod=mod -buildmode=pie -ldflags '-s -w -X main.version=v1.6.4-rc1-171-gd0f990ea -X pkg/awsutils/awssession.version=v1.6.4-rc1-171-gd0f990ea' -o grpc-health-probe ./cmd/grpc-health-probe
# github.com/aws/amazon-vpc-cni-k8s/cmd/grpc-health-probe
loadinternal: cannot find runtime/cgo

pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
pkg/ipamd/ipamd.go Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Error with merge
pkg/ipamd/ipamd.go Outdated Show resolved Hide resolved
pkg/ipamd/ipamd.go Outdated Show resolved Hide resolved
pkg/ipamd/ipamd.go Outdated Show resolved Hide resolved
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants