4
votes

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>
2
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
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: <ext IP of TCP service>Tim Bikbaev
@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
@HrishikeshKumar ive done it with haproxy on top of node ports - ugly solution, but the only solution that works for meTim Bikbaev

2 Answers

1
votes

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
0
votes

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