0

I am trying to expose certain Services Port Directly via Traefik Ingress, running on K3s. I have a usecase where I want to expose certain ports directly on Loadbalancer, like:

  • 8080 - Tomcat - TCP
  • 1700 - UDP
  • 1795 - TCP

I tried creating following config based on this thread from Nginx Repo (I know it's for Nginx, but, I couldn't find a suitable doc in Traefik) :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: multiportsvc
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
  - host: node2.givmecloud.in
    http:
      paths:
          #- path: /
       - backend:
            serviceName: webui
            servicePort: 80
        - backend:
            serviceName: the-udp-service
            servicePort: 1700
        - backend:
            serviceName: tomcat-tcp-service
            servicePort: 8080

However, the PORTS are not directly exposed on Ingress, just port 80/443 seems to be exposed on loadbalancer. I think this SO thread mentions that it's not directly possible:

Nginx seems to support this, I check this Nginx documentation: https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/

Is it something that's possible with traefik either via v1 or v2 or I need to use Nginx or MetalLB for this type of usecase if not, what's recommended for this kind of use cases?

Thanks,

Ravish
  • 2,383
  • 4
  • 37
  • 55
  • 1
    So, as you already saw in [Open other ports more than HTTP & HTTPS in Traefik Kubernetes Ingress](https://stackoverflow.com/questions/61502317/open-other-ports-more-than-http-https-in-traefik-kubernetes-ingress/61507502#61507502), its not possible to to with Traefik. – Vit Jul 20 '21 at 17:47
  • Yes, I saw that and Nginx Ingress does not support multiprotocol configuration for Ingress, so, my option left is to user either NGINX Ingress or Metal LB and may be use multiple LBs because you can not expose TCP and UDP on same LB @Vit – Ravish Jul 22 '21 at 13:56

0 Answers0