kubernetesgoogle-kubernetes-enginecoturn

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?


Solution

  • 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.