Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy TURN server(coturn) inside Kubernetes

I am trying to deploy coturn server in the Kubernetes cluster.

According to the startup manual, it seems to each server has to have own external IP address. But I can't find a way to bind external IP addresses to each coturn pods.

How can I solve this problem? Or should I place server outside of Kubernetes cluster?

like image 741
Jaemin Park Avatar asked Nov 28 '17 04:11

Jaemin Park


2 Answers

The simplest way for this would be to use a DaemonSet with hostNetwork: true. That way you will have a coturn server for each of the node servers with direct access to the external interface.

like image 124
Pedro Avatar answered Sep 22 '22 13:09

Pedro


Although you can't assign a static IP directly to a pod, you can create a service that exposes the pods and allows you to route traffic to them via an external IP address.

For example, you could expose the deployment by running the following command which would create a service (this command presumes your application is listening on port 8080):

kubectl expose deployment DEPLOYMENT_NAME --type=LoadBalancer --port 80 --target-port 8080

To retrieve the resulting external IP address run:

kubectl get services

There is some more information on this here

You could also generate an external IP by creating an ingress resource as detailed here.

like image 27
neilH Avatar answered Sep 24 '22 13:09

neilH