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

kubelet, pluto: support IPv6 #1710

Merged
merged 3 commits into from
Sep 28, 2021
Merged

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Aug 11, 2021

Issue number:
Closes #1696

Description of changes:

Author: Erikson Tung <etung@amazon.com>
Date:   Mon Sep 13 15:59:59 2021 -0700

    kubernetes-1.21: patch kubelet to support ipv6 with AWS
    
    This adds a patch to the in-tree AWS cloud provider code to make kubelet
    append IPv6 addresses to the list of NodeAddresses.

Author: Erikson Tung <etung@amazon.com>
Date:   Mon Aug 9 12:27:23 2021 -0700

    pluto: support IPv6
    
    This adds support for retrieving IPv6 node IP address for IPv6 EKS
    clusters


Author: Erikson Tung <etung@amazon.com>
Date:   Fri Aug 13 11:00:47 2021 -0700

    release: enable IPv6 forwarding

The testing below has been done with IPv6 changes in aws-vpc-cni that has yet to be formally released: aws/amazon-vpc-cni-k8s#1587

Testing done:

Testing for IPv6 EKS Clusters:
Created an AMI off of the built images and launched an EC2 instance in my IPv6 EKS cluster.
The node is able to get an IPv6 internal IP address:

$ kubectl get nodes -o wide
NAME                                          STATUS   ROLES    AGE   VERSION   INTERNAL-IP                              EXTERNAL-IP      OS-IMAGE                KERNEL-VERSION   CONTAINER-RUNTIME
ip-192-168-3-236.us-west-2.compute.internal   Ready    <none>   26m   v1.21.3   2600:1f13:8ff:6600:6a76:135f:ee92:3395   54.188.180.229   Bottlerocket OS 1.2.0   5.10.50          containerd://1.4.8+bottlerocket

Can run pods without problem. The pods get IPv6 addresses assigned without problem. I can ping external ipv4 and ipv6 addresses without problem.

Testing for IPv4 EKS Clusters:
Launched node with AMI in IPv4 cluster.
Node becomes Ready with the correct node-ip and cluster-dns-ip:

$ kubectl get nodes -o wide
NAME                                           STATUS   ROLES    AGE   VERSION   INTERNAL-IP      EXTERNAL-IP     OS-IMAGE                KERNEL-VERSION   CONTAINER-RUNTIME
ip-192-168-1-232.us-west-2.compute.internal    Ready    <none>   28s   v1.21.3   192.168.1.232    54.190.54.101   Bottlerocket OS 1.2.0   5.10.50          containerd://1.4.8+bottlerocket

Can run pods without problem.

Ran conformance tests with an IPv6 cluster and all tests passed.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

sources/api/pluto/src/main.rs Outdated Show resolved Hide resolved
sources/api/pluto/src/main.rs Outdated Show resolved Hide resolved
@etungsten etungsten force-pushed the eks-ipv6 branch 3 times, most recently from e6cd791 to 88e2b6a Compare August 13, 2021 17:34
@etungsten
Copy link
Contributor Author

Push above addresses @webern 's comments.

  • Removed rusoto related imports from main.rs
  • Created new type alias for rusoto_eks::KubernetesNetworkConfigResponse for sake of brevity
  • Fixed unit tests

@etungsten

This comment has been minimized.

@etungsten etungsten changed the title pluto: support IPv6 clusters pluto: support IPv6 Sep 10, 2021
@etungsten
Copy link
Contributor Author

Push above changes the approach to determining EKS cluster IP family. Instead of making a call to EKS API to determine the cluster's IP family, we check cluster-dns-ip's IP family and if it's an IPv4 we assign the instance's IPv4 IP as node-ip; If it's an IPv6 address, we assign the instance's IPv6 address to be the node-ip.

When users want to give their nodes an IPv6 node IP address for an IPv6 EKS Cluster, they need to set the cluster's DNS IP to settings.kubernetes.cluster-dns-ip via instance userdata.

This is a temporary measure until the EKS API provides ways to let us automatically determine the IP family and service IPv6 CIDR.

@etungsten
Copy link
Contributor Author

Push above fixes README documentation for settings.kubernetes.node-ip and settings.kubernetes.cluster-dns-ip.

This adds a patch to the in-tree AWS cloud provider code to make kubelet
append IPv6 addresses to the list of NodeAddresses.
@etungsten
Copy link
Contributor Author

Push above adds the patch to kubelet for supporting ipv6 node addresses in AWS.
Tested everything and they work as expected.

@etungsten etungsten changed the title pluto: support IPv6 kubelet, pluto: support IPv6 Sep 13, 2021
@etungsten etungsten requested a review from webern September 13, 2021 23:21
@etungsten etungsten marked this pull request as ready for review September 14, 2021 23:21
README.md Outdated Show resolved Hide resolved
packages/release/release-sysctl.conf Outdated Show resolved Hide resolved
sources/imdsclient/src/lib.rs Outdated Show resolved Hide resolved
sources/api/pluto/src/main.rs Outdated Show resolved Hide resolved
@etungsten etungsten force-pushed the eks-ipv6 branch 2 times, most recently from e3d6948 to 2e0ed0b Compare September 21, 2021 19:20
@etungsten
Copy link
Contributor Author

etungsten commented Sep 21, 2021

Pushes above addresses @bcressey 's comments. Tested the changes and they still work as expected.

@etungsten etungsten requested a review from bcressey September 21, 2021 19:31
sources/api/pluto/README.md Outdated Show resolved Hide resolved
sources/imdsclient/src/lib.rs Outdated Show resolved Hide resolved
))]
AwsInfo { source: api::Error },

#[snafu(display("Missing field '{}' in EKS kubernetes network config response", field))]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
#[snafu(display("Missing field '{}' in EKS kubernetes network config response", field))]
#[snafu(display("Missing field '{}' in EKS network config response", field))]

@etungsten
Copy link
Contributor Author

Push above addresses comments by @bcressey . Tested and things still work as expected.

@etungsten etungsten requested a review from bcressey September 22, 2021 17:03
@etungsten
Copy link
Contributor Author

Push above addresses Matt's comment #1710 (comment)

@etungsten etungsten requested a review from webern September 22, 2021 19:18
This adds support for retrieving IPv6 node IP address for IPv6 EKS
clusters
@etungsten
Copy link
Contributor Author

Push above fixes the fallthrough for determining the cluster dns ip.

@etungsten
Copy link
Contributor Author

etungsten commented Sep 24, 2021

Ran conformance tests with an IPv6 cluster and all tests passed.

@etungsten etungsten merged commit dbaa456 into bottlerocket-os:develop Sep 28, 2021
@etungsten etungsten deleted the eks-ipv6 branch September 28, 2021 18:16
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.

aws-k8s variants: support IPv6
3 participants