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

Configure tcp routing from ingress to the service #126

Closed
wants to merge 1 commit into from

Conversation

AlMaVizca
Copy link
Contributor

This is related to #121.

In case ClusterIP is used, the service could be exposed using the ingress controller router.
These configurations are defined on the following link, section -> "using the PROXY Protocol" and "Configure the ingress controller"

I'm currently using traefik, I couldn't find a way to test the nginx configurations, the definition is based on what the docs mention.

@AlMaVizca AlMaVizca requested a review from funkypenguin as a code owner July 5, 2024 10:13
In case ClusterIP is used, the service could be exposed using the
ingress controller router.
This configurations are defined on "using the PROXY Protocol" and
"Configure the ingress controller"
https://docker-mailserver.github.io/docker-mailserver/latest/config/advanced/kubernetes/#exposing-your-mail-server-to-the-outside-world

Signed-off-by: Aldo Maria Vizcaino <[email protected]>
@cfis
Copy link
Collaborator

cfis commented Jul 9, 2024

Thanks for the PR.

Ingresses aren't meant to support non http or https traffic. If you are using ingress-nginx side, then you would not setup an ingress. Instead you would update its deployment by setting the tcp key that is here:

https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx/values.yaml#L186

Docs here (which you obviously saw):

https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/

For example, in my home setup:

tcp:
  465:  "mail/docker-mailserver:10465::PROXY"
  587:  "mail/docker-mailserver:10587::PROXY"
  993:  "mail/docker-mailserver:10993::PROXY"

That creates the configmap you have the PR.

Then you route traffic to nginx either via a load balancer or have nginx itself listen on the specified host ports. Either way, no ingress is involved.

I am not familiar with traefik, but it looks like it extended ingresses to support tcp traffic. But that would be non-standard between implementations.

A more standardized path forward would be use K8 Gateway API. Traefik does support the api, but not yet the tcp routing part of it - see https://doc.traefik.io/traefik/providers/kubernetes-gateway.

So I appreciate the PR, but I don't think it should merged (in the same way I haven't added any nginx specific support either).

@AlMaVizca
Copy link
Contributor Author

Alright, thanks for taking the time to explain.
I'm using traefik, and indeed, it extends the ingress to provide TCP and UDP routing.

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.

2 participants