AKS(kubernetes) service with UDP and TCP

10/22/2018

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>
-- Tim Bikbaev
azure-aks
kubernetes

2 Answers

10/23/2018

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

-- Tim Bikbaev
Source: StackOverflow

10/22/2018

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
Source: StackOverflow