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

pkg/ipam: dynamically fetch the allocatable ipv4 addresses amount from instance limits #10831

Merged
merged 1 commit into from May 4, 2020

Conversation

mvisonneau
Copy link
Contributor

@mvisonneau mvisonneau commented Apr 2, 2020

This PR is a follow-up of #10786

It primarily focuses on AWS, dynamically figuring out how many addresses we could potentially be allocated to an instance. This will ensure the cilium-operator does not go into a IP deficit loop whenever all the IPv4s of have been allocated and used.

IPAM: dynamically fetch the allocatable ipv4 addresses amount from instance limits (AWS)

@maintainer-s-little-helper
Copy link

Commit 0c7a2a8bbb31504ba2e6b060ffce9e56597936e9 does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Apr 2, 2020
@maintainer-s-little-helper
Copy link

Please set the appropriate release note label.

@maintainer-s-little-helper
Copy link

Please set the appropriate release note label.

@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.8.0 Apr 2, 2020
@maintainer-s-little-helper
Copy link

Commit 0c7a2a8bbb31504ba2e6b060ffce9e56597936e9 does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper
Copy link

Commit 0c7a2a8bbb31504ba2e6b060ffce9e56597936e9 does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@mvisonneau
Copy link
Contributor Author

I have just tested it on an EKS cluster in conjuction with #10786.

Only updated the deployment image of the operator:
s/image: docker.io/cilium/operator:v1.7.1/image: docker.io/mvisonneau/cilium-operator:1.7.1-1

The logs have been dropping instantly 👌

image

@joestringer joestringer added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Apr 6, 2020
@joestringer
Copy link
Member

Nice!

Looks like Travis is failing (make unit-tests locally), otherwise let us know when you're looking for review on this by switching it out from draft status.

@joestringer
Copy link
Member

test-me-please

@mvisonneau
Copy link
Contributor Author

thanks @joestringer, I reckon it is ready to be reviewed. As it is including 366b94ef4f4d82196b7dfc4cad69e1c498d3ed10 from #10786 I was waiting for it to be merged before though. Do you want to superseed it?

@joestringer
Copy link
Member

joestringer commented Apr 7, 2020

I think github requires the first PR to be merged first, then to rebase this PR once the first one is merged.

I note that the various checks have a lot of failures, at the very least I think it's worth digging into what Travis has to say as it has a lower false-positive rate.

Glancing at the Cilium-Tests-With-Kernel it seems like an instance of #10821 .

Also the Maintainer's little helper has provided instructions how to sign off your commits, which is a prerequisite for merging code into Cilium.

@mvisonneau
Copy link
Contributor Author

Indeed, I'll have a look into this issue right away! Regarding the commits signoff I reckon that both of them already are. unless I missed something 🤔

@joestringer
Copy link
Member

joestringer commented Apr 8, 2020

Maybe there was a hiccup with the commits signoff checker, they look good to me. It may resolve itself when you rebase / re-push. If this is not the case, we can investigate further.

@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Apr 10, 2020
@mvisonneau mvisonneau force-pushed the ipam/maxAllocateFromLimits branch 4 times, most recently from 275793c to 88d08c1 Compare April 15, 2020 17:47
@coveralls
Copy link

coveralls commented Apr 15, 2020

Coverage Status

Coverage increased (+0.02%) to 44.51% when pulling 0682e48 on mvisonneau:ipam/maxAllocateFromLimits into 50d4acb on cilium:master.

@mvisonneau mvisonneau marked this pull request as ready for review April 15, 2020 19:47
@mvisonneau mvisonneau requested a review from a team as a code owner April 15, 2020 19:47
@mvisonneau
Copy link
Contributor Author

@joestringer thanks for the merge of #10786 🙇

I rebased this one and fixed the failing unit test, it is now ready to be reviewed.

@joestringer
Copy link
Member

joestringer commented Apr 15, 2020

test-me-please failed to provision https://jenkins.cilium.io/job/Cilium-PR-Ginkgo-Tests-Validated/18818/

@mvisonneau mvisonneau force-pushed the ipam/maxAllocateFromLimits branch 2 times, most recently from 880026e to c3465b7 Compare April 24, 2020 10:05
@joestringer
Copy link
Member

Not sure which of @aanm @tgraf @ungureanuvladvictor would be best situated to look over the latest version of the core changes from this PR.

pkg/ipam/node.go Outdated Show resolved Hide resolved
pkg/aws/eni/node.go Outdated Show resolved Hide resolved
pkg/aws/eni/node.go Outdated Show resolved Hide resolved
@mvisonneau mvisonneau force-pushed the ipam/maxAllocateFromLimits branch 3 times, most recently from 0e419bc to 7a79f03 Compare April 27, 2020 13:17
Copy link
Member

@ungureanuvladvictor ungureanuvladvictor left a comment

Choose a reason for hiding this comment

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

LGTM from my side.


// GetMaximumAllocatableIPv4 returns the maximum amount of IPv4 addresses
// that can be allocated to the instance
// TODO: If this is necessary for Azure, need to figure out how to get or
Copy link
Member

Choose a reason for hiding this comment

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

The limits for Azure are 256 across a node (also 256 on a NIC). So in total you can every combination but in total across all NICs on a node needs to be max 256.

https://github.com/MicrosoftDocs/azure-docs/blob/master/includes/azure-virtual-network-limits.md#networking-limits---azure-resource-manager for deets on it.

Copy link
Member

Choose a reason for hiding this comment

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

@ungureanuvladvictor @mvisonneau do you want to address this in this PR or do you think it's more appropriate to split out into a separate PR to enable this functionality on the Azure side?

Choose a reason for hiding this comment

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

I know this went through many iterations so I approved it so it does not stay in the queue much time.

If @mvisonneau wants to fix this I'm happy to take another look.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh thanks for the info, I will update it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@ungureanuvladvictor
Copy link
Member

test-me-please

@ungureanuvladvictor
Copy link
Member

test-gke

@joestringer
Copy link
Member

Looks like GKE hit known flake #11105 , also GKE is not required to merge the PR. Safe to ignore.

Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

Overall flow and general logging etc looks good.

// TODO: If this is necessary for Azure, need to figure out how to get or
// compute the limits
func (n *Node) GetMaximumAllocatableIPv4() int {
return 0
Copy link
Member

Choose a reason for hiding this comment

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

This can just return InterfaceAddressLimit from pkg/azure/types

Copy link
Contributor Author

@mvisonneau mvisonneau May 1, 2020

Choose a reason for hiding this comment

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

very cool, thanks for the info! I will configure it and try to work on a few additionnal tests 👍

Copy link
Contributor Author

@mvisonneau mvisonneau May 1, 2020

Choose a reason for hiding this comment

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

done, I also added some more tests on both aws and azure functions (TestGetMaximumAllocatableIPv4)

I haven't done any addtional tests on the azure side on how this integrates with the node_manager though.

@ungureanuvladvictor
Copy link
Member

test-me-please

@qmonnet qmonnet self-assigned this May 1, 2020
@qmonnet
Copy link
Member

qmonnet commented May 1, 2020

test-me-please

pkg/aws/eni/node_test.go Show resolved Hide resolved
pkg/aws/eni/node_test.go Outdated Show resolved Hide resolved
… types limits

Signed-off-by: Maxime VISONNEAU <maxime.visonneau@gmail.com>
@qmonnet
Copy link
Member

qmonnet commented May 1, 2020

test-me-please

@ungureanuvladvictor ungureanuvladvictor added the integration/cloud Related to integration with cloud environments such as AKS, EKS, GKE, etc. label May 2, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 4, 2020
@qmonnet qmonnet merged commit 5cc56f7 into cilium:master May 4, 2020
1.8.0 automation moved this from In progress to Merged May 4, 2020
@mvisonneau mvisonneau deleted the ipam/maxAllocateFromLimits branch May 4, 2020 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration/cloud Related to integration with cloud environments such as AKS, EKS, GKE, etc. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
No open projects
1.8.0
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

7 participants