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

SNI routingmodule and routing of TCP traffic with TransportServer #6324

Closed
3 tasks done
shaun-nx opened this issue Sep 2, 2024 Discussed in #5544 · 1 comment
Closed
3 tasks done

SNI routingmodule and routing of TCP traffic with TransportServer #6324

shaun-nx opened this issue Sep 2, 2024 Discussed in #5544 · 1 comment
Labels
backlog Pull requests/issues that are backlog items refined Issues that are ready to be prioritized
Milestone

Comments

@shaun-nx
Copy link
Contributor

shaun-nx commented Sep 2, 2024

Overview

As a maintainer of NGINX Ingress Controller, I would like to enable users of our TransportServer resource to route traffic to their backend services using a Server Name Indicator (SNI) provided by a Host Header, so that resources hosted on the same server can be identified by their host name, even if they are on the same host IP.

High-level Functional Requirements

  • Enable TransportServer to dynamically route traffic based on the value of the HostHeader
  • Enable TransportServer to be deployed with a host field in its spec, without requiring tls-passthrough to be enabled

Definition of Done

Development

  • Unit tests are written to cover functionality delivered in the story.
  • Make sure that the unit test passes before creating a pull request.
  • Make sure that the test coverage stays optimal.
  • Run make lint locally before creating a PR.

Testing

  • Automated tests are written as part of the story.
  • Run “make lint-python“ from root
  • Acceptance criteria are met.
  • Stories are demonstrated to the team.
  • Product Manager accepts the story as done.
  • If a feature requires changes/extensions of the Helm chart, those shall be done as part of the story.

Release Notes & Documentation

  • PR is labeled appropriately so they display in GitHub release notes.
  • Create/update documentation related to the user story.
  • Create/update the example in our codebase when applicable.

Additional Context

SNI based routing of Layer 4 traffic is a way to support customers using DNS names for TCP traffic and support routing based on the SNI header.
With NGINX this is implemented using the stream ssl pre-read module.
https://nginx.org/en/docs/stream/ngx_stream_ssl_preread_module.html

This module is already present in the NGINX Plus binary.

Today, this is possible with heavy use of snippets. The ask is to make this present and first class with the TransportServer resource.

This also historically described here:
https://stackoverflow.com/questions/34741571/nginx-tcp-forwarding-based-on-hostname

There are some additional considerations that need to be included here:

  • The possibility for greater flexibility with TransportServer

The overall concept is multiple upstream targets for TCP behind a single listener and to route based on SNI.
This would support both TLS Passthrough as well as advanced programmability that might require TLS decryption and re-encryption.

To bring this all together:

  • TransportServer would include the option for a top level domain type SNI match ( foo.com )
  • Following a concept similar to an http path or nginx location - the extension of a service specific route that matches to the backend service (service.foo.com)
  • This would support TLS passthrough and decrypted TLS (it would use preread)

TLS traffic in -> TransportServer matched TLS of HostHeader -> Routes to appropriate upstream based on HostHeader

POC Tasks

Preview Give feedback
  1. 3 of 3
    backlog
    j1m-ryan
  2. 1 of 1
    backlog

Implementation Tasks

Preview Give feedback
  1. backlog
    j1m-ryan
@shaun-nx shaun-nx added the epic Issues that need to be broken into smaller issues label Sep 2, 2024
@shaun-nx shaun-nx moved this from Todo ☑ to Prioritized backlog in NGINX Ingress Controller Sep 2, 2024
Copy link

github-actions bot commented Sep 2, 2024

Hi @shaun-nx thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this 🙂

Cheers!

@shaun-nx shaun-nx added ready for refinement An issue that was triaged and it is ready to be refined needs more info Issues that require more information labels Sep 2, 2024
@shaun-nx shaun-nx modified the milestones: v3.8.0, v4.0.0 Sep 5, 2024
@shaun-nx shaun-nx removed ready for refinement An issue that was triaged and it is ready to be refined needs more info Issues that require more information labels Sep 9, 2024
@shaun-nx shaun-nx modified the milestones: v4.0.0, v3.8.0 Sep 10, 2024
@shaun-nx shaun-nx added backlog Pull requests/issues that are backlog items refined Issues that are ready to be prioritized labels Sep 17, 2024
@shaun-nx shaun-nx modified the milestones: v3.8.0, v4.0.0 Sep 19, 2024
@shaun-nx shaun-nx changed the title Support SNI preread module and routing of TCP traffic with TransportServer SNI routingmodule and routing of TCP traffic with TransportServer Oct 1, 2024
@j1m-ryan j1m-ryan mentioned this issue Oct 11, 2024
6 tasks
@shaun-nx shaun-nx moved this from Prioritized backlog to In Progress 🛠 in NGINX Ingress Controller Oct 14, 2024
@shaun-nx shaun-nx removed the epic Issues that need to be broken into smaller issues label Oct 14, 2024
@github-project-automation github-project-automation bot moved this from In Progress 🛠 to Done 🚀 in NGINX Ingress Controller Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Pull requests/issues that are backlog items refined Issues that are ready to be prioritized
Projects
Archived in project
Development

No branches or pull requests

1 participant