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 support for IPv6 Fargate nodes #565

Merged
merged 1 commit into from
Mar 16, 2023

Conversation

HusainZafar
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR adds support for IPv6 Fargate nodes by assigning the right NodeInternalIP based on IP family

Which issue(s) this PR fixes:
NONE

Special notes for your reviewer:
This code doesn't change anything for EC2 worker nodes

Does this PR introduce a user-facing change?:
No

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. 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 Jan 27, 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 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 Jan 27, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @HusainZafar. 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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 27, 2023
@HusainZafar HusainZafar changed the title Husaiz branch Add support for IPv6 Fargate nodes Jan 28, 2023
@rsumukha
Copy link

/lgtm

@k8s-ci-robot
Copy link
Contributor

@rsumukha: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

Copy link
Member

@olemarkus olemarkus left a comment

Choose a reason for hiding this comment

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

Fargate is dualstack isn't it? So I think I'd like to see more cases for that behaving consistently with EC2.

pkg/providers/v1/aws.go Outdated Show resolved Hide resolved
return getNodeAddressesForFargateNode(aws.StringValue(eni.PrivateDnsName), aws.StringValue(eni.PrivateIpAddress)), nil

// Assign NodeInternalIP based on IP family
if eni.Ipv6Addresses != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean node IPs are either/or? I think this needs to respect c.cfg.Global.NodeIPFamilies

Copy link
Contributor Author

@HusainZafar HusainZafar Mar 14, 2023

Choose a reason for hiding this comment

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

Updated the PR to set the IP based on NodeIPFamilies consistent with EC2 nodes and verified that the addresses field with cloud provider is consistent with addresses field without cloud provider enabled for Fargate nodes

@HusainZafar HusainZafar requested review from olemarkus and removed request for nckturner and kishorj March 14, 2023 00:28
@nckturner
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 15, 2023
nodeAddresses := getNodeAddressesForFargateNode(aws.StringValue(eni.PrivateDnsName), aws.StringValue(eni.PrivateIpAddress))
addresses = append(addresses, nodeAddresses...)
case "ipv6":
internalIPv6Address := eni.Ipv6Addresses[0].Ipv6Address
Copy link
Contributor

Choose a reason for hiding this comment

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

Even if the NodeIPFamily is set to ipv6, I wonder if its possible for the ENI to not have IPv6 addresses due to a misconfiguration or something. Can we check to make sure the addresses exist and handle a failure case before referencing the first item in the list here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack, added a check to make sure Ipv6Addresses is not missing or empty

Copy link
Contributor

@nckturner nckturner Mar 16, 2023

Choose a reason for hiding this comment

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

Ok sounds good, but one more question... is it better to return an error here or to just log it and move forward with non-ipv6 addresses? I'm thinking maybe best effort is better here because in some world (even if not supported today with fargate) could there be both ipv4 and ipv6 address NodeIPFamilies set, and in that case we'd still want to return the ipv4 addresses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Valid point for that use case, I have updated to log the error and return the existing addresses

@nckturner
Copy link
Contributor

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 15, 2023
@HusainZafar HusainZafar requested review from nckturner and removed request for olemarkus March 16, 2023 00:44
@nckturner
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 16, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nckturner

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2023
@nckturner
Copy link
Contributor

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 16, 2023
@nckturner
Copy link
Contributor

@HusainZafar will you squash you commits please?

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 16, 2023
@nckturner
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 16, 2023
@nckturner
Copy link
Contributor

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 16, 2023
@k8s-ci-robot k8s-ci-robot merged commit fba619f into kubernetes:master Mar 16, 2023
@HusainZafar HusainZafar deleted the husaiz-branch branch March 16, 2023 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants