4

My dockerized service (webrtc server) uses both TCP and UDP transport protocols. I'm working with Azure Kubernetes service. As you know we cannot create LoadBalancer service in Kubernetes with both TCP and UDP proto (more info here)

Also, I've tried to create two services:

  • one for TCP ports
  • one for UDP

bind them with one public IP, but gets: "Ensuring load balancer" message.

The only solution is to use NodePort, but in Azure its not working for me (connection timeout).

Here my service yaml:

apiVersion: v1
kind: Service
metadata:
  name: mcu
spec:
  selector:
   app: mcu
  ports:
  - name: mcu
    nodePort: 30000
    port: 8080
    protocol: TCP
  - name: webrtc
    nodePort: 30003
    port: 10000
    protocol: UDP
  type: NodePort
  externalIPs:
  - <ext IP>
Rico
  • 58,485
  • 12
  • 111
  • 141
Tim Bikbaev
  • 86
  • 1
  • 8
  • Can you please share a link to how you could set it up for just TCP? I am trying to resolve a similar issue. – GrimSmiler Oct 22 '18 at 14:27
  • not follow what link are you talking about, but for TCP service ive exposing couple of TCP ports with `type: LoadBalancer` and for UDP - same, but with `loadBalancerIP: ` – Tim Bikbaev Oct 22 '18 at 14:43
  • @TimBikbaev: Did you get it to work or did you find an alternative - please update here....I am also having the same issue... – Hrishikesh Kumar Jul 18 '19 at 08:30
  • 1
    @HrishikeshKumar ive done it with haproxy on top of node ports - ugly solution, but the only solution that works for me – Tim Bikbaev Jul 19 '19 at 09:02

2 Answers2

1

The support for mixed TCP/UDP protocols depends on the cloud provider. For example, Azure supports it but AKS may not have a version that supports it as of this writing.

Not clear what is giving you a connection timeout but it should work fine as long as you point the Azure UDP load balancer to the30003 NodePort. You can also test locally in a cluster node sending UDP traffic to the Service ClusterIP:10000

You can also check if your service has endpoints:

$ kubectl describe svc <service-name>

Or/and:

$ kubectl get ep
Rico
  • 58,485
  • 12
  • 111
  • 141
  • thanks, already tried - NodePort connection works fine in EKS, but with AKS - i cannot telnet port on worker, already rechecked network rules,seems ok – Tim Bikbaev Oct 23 '18 at 09:28
  • You will not be able to telnet to a UDP port since telnet uses TCP. You will have to use something like netcat: `nc -zuv ` – Rico Oct 23 '18 at 15:56
  • i know , im telneting TCP ports only – Tim Bikbaev Oct 24 '18 at 08:25
0

Seems AKS doesnt support NodePort and AKS service type LoadBalancer not working with both TCP and UDP protocols on same service

Tim Bikbaev
  • 86
  • 1
  • 8