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

Add IPv6 addresses to node addresses list #639

Closed
wants to merge 1 commit into from

Conversation

james-callahan
Copy link

@james-callahan james-callahan commented Aug 14, 2023

What type of PR is this?
/kind bug

What this PR does / why we need it:

Add IPv6 addresses to node addresses list in the v2 provider

Which issue(s) this PR fixes:

Fixes #638

Special notes for your reviewer:

I'm not sure if this should be considered a bugfix or a feature.

Does this PR introduce a user-facing change?:

fix support for IPv6 addresses in v2 provider

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 14, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If cloud-provider-aws contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

Welcome @james-callahan!

It looks like this is your first PR to kubernetes/cloud-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/cloud-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @james-callahan. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 14, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kishorj for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 14, 2023
@olemarkus
Copy link
Member

I see this PR goes against v2, which has sort of been abandoned. This feature is already available in v1.

@james-callahan
Copy link
Author

I see this PR goes against v2, which has sort of been abandoned. This feature is already available in v1.

I've been using v2 happily for some time now.
Last time I tried out v1 there was something that didn't work well... I can't remember what it was off the top of my head.

In any case, this PR should fix a missing piece of functionality from v2.

@@ -226,6 +226,20 @@ func nodeAddressesForInstance(instance *ec2.Instance) ([]v1.NodeAddress, error)
})
}
}

for _, privateIP := range networkInterface.Ipv6Addresses {
Copy link
Contributor

@cartermckinnon cartermckinnon Aug 14, 2023

Choose a reason for hiding this comment

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

The behavior in the v1 provider is a bit different, we only utilize the first entry in this slice: https://github.com/kubernetes/cloud-provider-aws/blob/master/pkg/providers/v1/aws.go#L1574

I don't have the context as to why that was done.

Copy link
Author

@james-callahan james-callahan Aug 15, 2023

Choose a reason for hiding this comment

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

I'm happy to swap to that behaviour instead if that'll get the PR landed.

I don't have the context as to why that was done.

My guess is that because the first IP cannot be modified (I vaguely recall this from somewhere?); but the others can at runtime by modifying the ENI(s); and the author of v1 was trying to keep it as a static list?

Copy link
Contributor

@cartermckinnon cartermckinnon Sep 14, 2023

Choose a reason for hiding this comment

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

This is kind of related to: #656

The VPC CNI will allocate and utilize additional ENI's for pod IP's. The pod IP's are filtered out from the Node's addresses when the provided-node-ip annotation is present: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cloud-provider/node/helpers/address.go#L115-L120

But ideally we wouldn't add Pod IP's to the Node's addresses in the first place. I think we should only be adding the first address on the first ENI

@tzneal WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering if we should just use the PrivateDnsName/PrivateIpAddress from the describe-instances output and ignore ENIs. Anything we can do will break someone, maybe a flag to control what we do?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm yeah I think you're right; that's what we end up with in practice on EKS anyway. But I'm not sure how this would impact other CNI's, cluster addons, etc; so making it configurable is a safe bet.

@james-callahan
Copy link
Author

@olemarkus is there something I can do to help get this merged?

@olemarkus
Copy link
Member

Sorry, I'm not approving PRs against v2. I only maintain v1.

@cartermckinnon
Copy link
Contributor

Going to close this in light of #677.

/close

@k8s-ci-robot
Copy link
Contributor

@cartermckinnon: Closed this PR.

In response to this:

Going to close this in light of #677.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for IPv6/dualstack
5 participants