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 IPv4/IPv6 dual-stack support #563

Open
leblancd opened this Issue Apr 18, 2018 · 29 comments

Comments

@leblancd
Copy link

leblancd commented Apr 18, 2018

Feature Description

  • One-line feature description (can be used as a release note):
    IPv4/IPv6 dual-stack support and awareness for Kubernetes pods, nodes, and services
  • Primary contact (assignee): @leblancd
  • Responsible SIGs: sig-network
  • Design proposal link (community repo): Add IPv4/IPv6 dual stack KEP
  • Link to e2e and/or unit tests: TBD
  • Reviewer(s) - (for LGTM) recommend having 2+ reviewers (at least one from code-area OWNERS file) agreed to review. Reviewers from multiple companies preferred: @thockin @dcbw @luxas
  • Approver (likely from SIG/area to which feature belongs): @thockin
  • Feature target (which target equals to which milestone):
    • Alpha release target 1.11
    • Beta release target 1.13
    • Stable release target 1.14

Corresponding kubernetes/kubernetes Issue: kubernetes/kubernetes#62822

@leblancd

This comment has been minimized.

Copy link
Author

leblancd commented Apr 19, 2018

Cross Reference with kubernetes/kubernetes: Issue #62822

@justaugustus

This comment has been minimized.

Copy link
Member

justaugustus commented Apr 20, 2018

Thanks for the update!

/assign @leblancd
/kind feature
/sig network
/milestone 1.11

@idvoretskyi

This comment has been minimized.

Copy link
Member

idvoretskyi commented May 2, 2018

@leblancd

This comment has been minimized.

Copy link
Author

leblancd commented May 8, 2018

@idvoretskyi - No design doc yet, but we'll start collaborating on one shortly.

@sb1975

This comment has been minimized.

Copy link

sb1975 commented May 10, 2018

Does this mean Kubernetes Ingress will support Dual-Stack ?
Does this mean CNI ( Calico) would need to run Dual stack ( both BIRD and BIRD6 daemons for example) ?

@leblancd

This comment has been minimized.

Copy link
Author

leblancd commented May 11, 2018

@sb1975 - Regarding dual-stack ingress support, that's something we'll need to hash out, but here are my preliminary thoughts:

  • Dual stack ingress support will mostly depend upon which ingress controller you use (whether it's supported and how it's implemented). Existing ingress controllers will probably need some changes to support dual-stack.
  • I expect that the ingress configuration for a typical ingress controller won't change (the config might e.g. still map an L7 address to a service name / service port, with no mention of V4/V6 family)
  • In the case where a service has endpoint pods that are dual-stack, the ingress controller(s) might need changes to map ingress packets based on the packets' family, i.e. map IPv4 ingress packets to an IPv4 endpoint, and map IPv6 ingress packets to an IPv6 endpoint. For the purposes of load-balance weighting, a dual-stack endpoint should count as a single endpoint target.
  • We might want to consider FUTURE support for having an ingress controller map across V4/V6 families (map ingress IPv4 packets to an IPv6 backend, and vice versa), but our initial development will be for strict dual-stack (i.e. separate, independent stacks).
    ========================
    Regarding Calico and other CNI plugins:
  • The CNI plugins won't HAVE TO run in dual-stack mode if a cluster scenario doesn't require dual-stack, they should still be able to run IPv4-only or IPv6-only (if the plugin supports it).
  • Dual-stack support will probably require changes in the various CNI plugins, but that work is considered outside of the scope of this Kubernetes issue (we're focusing on making Kubernetes work for any arbitrary dual-stack plugin, probably using the bridge plugin as a reference), and the CNI work will be done separately on a case-by-case basis.
  • For Calico specifically, I'm not an expert but I believe that a single BIRD daemon can be configured to handle both IPv4 and IPv6 routes (search for "template bgp" here: http://bird.network.cz/?get_doc&v=20&f=bird-3.html#ss3.1). That said, although Calico already supports dual-stack addresses at the pod, there might be changes required to get the BGP routing working for both families.
@sb1975

This comment has been minimized.

Copy link

sb1975 commented May 15, 2018

@leblancd : So here is the scenario :

  1. Lets say we will use NGINX ingress controller
  2. I am exposing my services via Ingress.
  3. I am running my pods configured on dual-stack
  4. I am trying to reach the service remotely using A and AAAA dns-records.
    Hope all of these
  5. In summary : I want to connect to pod interfaces using either IPv4 or IPv6 addresses, as resolved by my own queries for A and/or AAAA records for the pod service name.
    Can I get involved in this initiative to test,documentation,architecture: but need some guidance.
    How do I get to know about the progress of this please.
@leblancd

This comment has been minimized.

Copy link
Author

leblancd commented May 17, 2018

@sb1975 - Good question re. the NGINX ingress controller with dual-stack. I'm not an expert on the NGINX ingress controller (maybe someone more familiar can jump in), but here's how I would see the work flow:

  • When you try to reach the Kube services from outside, your DNS controller should resolve the service with A and AAAA DNS records for the ingress controller. It would be your client/app's choice to use the A vs. the AAAA record to reach the ingress controller. So external access to the ingress controller would be dual-stack.
  • At the NGINX ingress controller, NGINX would then look at the L7 URL (regardless of request being in an IPv4 or IPv6 packet) and load balance that to upstream endpoints. If the ingress controller load balancer is configured with ipv6=on (which is default, see https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/#configuring-http-load-balancing-using-dns), and the service endpoint(s) are dual-stack, then the upstream configuration should have both IPv4 and IPv6 entries for each dual-stack endpoint. As designed, the NGINX load balancer treats the IPv4 entry and the IPv6 entry for an endpoint as separate servers. (See the line in the fore-mentioned doc "If a domain name resolves to several IP addresses, the addresses are saved to the upstream configuration and load balanced.") This can be considered good news or bad news. The good news is that load balancing will be done across IPv4 and IPv6 endpoints (giving you some redundancy), where e.g. an incoming IPv4 request could get mapped to either an IPv4 or an IPv6 endpoint. But the potential bad news is with load balancing granularity: a connection to an IPv4 endpoint and a connection to the corresponding IPv6 endpoint will be treated (for load balancing considerations) as 2 loads to separate endpoints, rather than 2 separate loads to the same endpoint. If this load-balancing granularity is a concern, then someone could disable load balancing to IPv6 (or to IPv4, if there's a config knob for that?), so that load balancing would be to IPv4-only endpoints. OR, maybe NGINX load balancer can be modified to treat a connection to an IPv4 address and a connection to its corresponding IPv6 address as 2 loads to the same endpoint.

As for helping and getting involved, this would be greatly appreciated! We're about to start working in earnest on dual-stack (it's been a little delayed by the work in getting CI working for IPv6-only). I'm hoping to come out with an outline for a spec (Google Doc or KEPs WIP doc) soon, and would be looking for help in reviewing, and maybe writing some sections. We'll also DEFINITELY need help with official documentation (beyond the design spec), and with defining and implementing dual-stack E2E tests. Some of the areas which I'm still a bit sketchy on for the design include:

  • How are health/liveness/readiness probes affected or handled with dual-stack
  • Will there be an impact on network policies?
  • Load balancer concerns?
  • Cloud provider plugin concerns?
  • L3/L4 ingress concerns?
    If you've thought about any of these, maybe you could help with those sections?

We're also considering an intermediate "dual-stack at the edge" (with IPv6-only inside the cluster) approach, where access from outside the cluster to K8s services would be dual-stack, but this would be mapped (e.g. via NGINX ingress controller) to IPv6-only endpoints inside the cluster (or use stateless NAT46). Pods and services in the cluster would need to be all IPv6, but the big advantage would be that dual-stack external access would be available much more quickly from a time-to-market perspective.

@caseydavenport

This comment has been minimized.

Copy link
Member

caseydavenport commented May 30, 2018

/milestone 1.12

@justaugustus

This comment has been minimized.

Copy link
Member

justaugustus commented May 31, 2018

@leblancd / @caseydavenport - I'm noticing a lot of discussion here and a milestone change.
Should this be pulled from the 1.11 milestone?

@leblancd

This comment has been minimized.

Copy link
Author

leblancd commented May 31, 2018

@justaugustus - Yes, this should be moved to 1.12. Do I need to delete a row in the release spreadsheet, or is there anything I need to do to get this changed?

@justaugustus

This comment has been minimized.

Copy link
Member

justaugustus commented Jun 1, 2018

@leblancd I've got it covered. Thanks for following up! :)

@justaugustus

This comment has been minimized.

Copy link
Member

justaugustus commented Jul 18, 2018

@leblancd @kubernetes/sig-network-feature-requests --

This feature was removed from the previous milestone, so we'd like to check in and see if there are any plans for this in Kubernetes 1.12.

If so, please ensure that this issue is up-to-date with ALL of the following information:

  • One-line feature description (can be used as a release note):
  • Primary contact (assignee):
  • Responsible SIGs:
  • Design proposal link (community repo):
  • Link to e2e and/or unit tests:
  • Reviewer(s) - (for LGTM) recommend having 2+ reviewers (at least one from code-area OWNERS file) agreed to review. Reviewers from multiple companies preferred:
  • Approver (likely from SIG/area to which feature belongs):
  • Feature target (which target equals to which milestone):
    • Alpha release target (x.y)
    • Beta release target (x.y)
    • Stable release target (x.y)

Set the following:

  • Description
  • Assignee(s)
  • Labels:
    • stage/{alpha,beta,stable}
    • sig/*
    • kind/feature

Please note that the Features Freeze is July 31st, after which any incomplete Feature issues will require an Exception request to be accepted into the milestone.

In addition, please be aware of the following relevant deadlines:

  • Docs deadline (open placeholder PRs): 8/21
  • Test case freeze: 8/28

Please make sure all PRs for features have relevant release notes included as well.

Happy shipping!

/cc @justaugustus @kacole2 @robertsandoval @rajendar38

@justaugustus

This comment has been minimized.

Copy link
Member

justaugustus commented Jul 31, 2018

@leblancd --
Feature Freeze is today. Are you planning on graduating this to Beta in Kubernetes 1.12?
If so, can you make sure everything is up-to-date, so I can include it on the 1.12 Feature tracking spreadsheet?

@leblancd

This comment has been minimized.

Copy link
Author

leblancd commented Jul 31, 2018

Hi @justaugustus - Beta status will need to slip into Kubernetes 1.13. We are making (albeit slow) progress on the design KEP (kubernetes/community#2254), and we're getting close to re-engaging with the CI test PR, but the Kubernetes 1.12 target was a bit too optimistic.

I'll update the description/summary above with the information you requested earlier. Thank you for your patience.

@justaugustus justaugustus modified the milestones: v1.12, v1.13 Jul 31, 2018

@justaugustus

This comment has been minimized.

Copy link
Member

justaugustus commented Jul 31, 2018

/remove-stage alpha
/stage beta

@k8s-ci-robot k8s-ci-robot added stage/beta and removed stage/alpha labels Jul 31, 2018

@justaugustus

This comment has been minimized.

Copy link
Member

justaugustus commented Jul 31, 2018

No worries, @leblancd. Thanks for the update!

@navjotsingh83

This comment has been minimized.

Copy link

navjotsingh83 commented Aug 1, 2018

Hi, @justaugustus @leblancd

I just read the update that the beta is moved to 1.13 for dual stack. What is the expected release date of 1.13? We are actually looking for dual stack support. Its a go-nogo decision for our product to move to containers.

@leblancd

This comment has been minimized.

Copy link
Author

leblancd commented Aug 1, 2018

@navjotsingh83 - I don't think the release date for Kubernetes 1.13 has been solidified. I don't see 1.13 listed in the Kubernetes releases documentation.

@AishSundar

This comment has been minimized.

Copy link

AishSundar commented Oct 4, 2018

@navjotsingh83 @leblancd 1.13 release schedule is published. Its a short release cycle with Code freeze on Nov 15th. Do you think its enough time to graduate this feature to Beta. Can you plz update this issue with your level of confidence, whats pending in terms of code, test and docs completion?

@AishSundar

This comment has been minimized.

Copy link

AishSundar commented Oct 4, 2018

As per discussion in the SIG Network meeting, though there will considerable work done on this feature in 1.13, it is not expected to go to Beta in 1.13. removing milestone accordingly.

/milestone clear

@k8s-ci-robot k8s-ci-robot removed this from the v1.13 milestone Oct 4, 2018

@AishSundar

This comment has been minimized.

Copy link

AishSundar commented Oct 4, 2018

@kacole2 to remove this from 1.13 enhancements spreadsheet

@kacole2 kacole2 added the tracked/no label Oct 8, 2018

@fejta-bot

This comment has been minimized.

Copy link

fejta-bot commented Jan 6, 2019

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@caseydavenport

This comment has been minimized.

Copy link
Member

caseydavenport commented Jan 9, 2019

/remove-lifecycle stale

@claurence

This comment has been minimized.

Copy link

claurence commented Jan 16, 2019

@leblancd Hello - I’m the enhancement’s lead for 1.14 and I’m checking in on this issue to see what work (if any) is being planned for the 1.14 release. Enhancements freeze is Jan 29th and I want to remind that all enhancements must have a KEP

@KevinAtDesignworx

This comment has been minimized.

Copy link

KevinAtDesignworx commented Jan 18, 2019

@leblancd Wanted to follow up on your prior comment relative to creating a delineation at the edge of the cluster for IPv4/IPv6:

“We're also considering an intermediate "dual-stack at the edge" (with IPv6-only inside the cluster) approach, where access from outside the cluster to K8s services would be dual-stack, but this would be mapped (e.g. via NGINX ingress controller) to IPv6-only endpoints inside the cluster (or use stateless NAT46). Pods and services in the cluster would need to be all IPv6, but the big advantage would be that dual-stack external access would be available much more quickly from a time-to-market perspective.”

This use case would be a good one for a current project, so wanted to see your thoughts around timeframe, see if there was anything myself or someone in our group could contribute to help out with this quicker time to market path.

@steebchen

This comment has been minimized.

Copy link

steebchen commented Jan 19, 2019

@KevinAtDesignworx If the edge-dual-stack but internal ipv6-only approach can still reach external ipv4 requests from inside a container (i.e. curl -v 93.184.216.34 -H "Host: example.com"), I genuinely think it's the best approach. If your infrastructure can use ipv6, why bother use ipv4 except at the edge for compatibility reasons. However, if this approach means that I can not reach legacy websites solely using ipv4 from inside my cluster, I'm not so sure anymore.

@schmitch

This comment has been minimized.

Copy link

schmitch commented Jan 19, 2019

well there is 464XLAT so ipv6 only inside the container would be feasable.

@leblancd

This comment has been minimized.

Copy link
Author

leblancd commented Feb 28, 2019

@KevinAtDesignworx - If using an ingress controller would work in your scenario, it's possible to configure an NGINX ingress controller for dual-stack operation from outside (proxying to single-family inside the cluster): https://github.com/leblancd/kube-v6#installing-a-dual-stack-ingress-controller-on-an-ipv6-only-kubernetes-cluster

The ingress controllers would need to run on the host network on each node, so the controllers wold need to be set up as a daemonset (one ingress controller on each node). This assumes:

  • Your nodes are dual-stack (as opposed to pods and services being single-family)
  • Your /etc/hosts on each node has IPv6 entries, and only IPv6 entries (no IPv4 addresses) for that node's hostname.

This would be in addition to a NAT64/DNS64 for connections from V6 clients inside the cluster to external IPv4-only servers.

Stateless NAT46 is also an option, but I haven't tried that, so I don't have any config guides for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.