<p>Fore few days I've been playing with Kubernetes cluster on Azure Container Service, with goal to host Unreal game servers on it.</p>

<p>After days of experiments and few questions on SO I got to the point where I can host few servers on single node and connect to them with clients.</p>

<p>In my latest setup I deployed PODs directly with hostNetwork: true.
Added LoadBalancer with public IP and manually mapped ports from agent node where pods are deployed to NAT load balancer.</p>

<p>While works I'm not entirely convinced it is good solution. While it can be automated I'm not sure it will be scalable under load.</p>

<ol>
<li><p>I need to wait until pod is created. I can assume what port is needed, because unreal aromatically open on 7777 port and then increment by one until it find one.</p></li>
<li><p>Once pod is created I need to add NAT port forwarding to load balancer (but I can't do it until I know on which Node pod is located).</p></li>
<li><p>Adding new NAT rules to load balancer takes time. Quite a bit of time, from what I have seen so far.</p></li>
<li><p>I'm using external load balancer to route traffic at particular PODs. It probabaly would be better to do it from within Kubernetes.</p></li>
</ol>

<p>There few things that must be meet:</p>

<ol>
<li><p>Client connect to server trough UDP.</p></li>
<li><p>It would be best keep amount of public IPs to minimum.</p></li>
</ol>

<p>What would be best way to directly expose PODs trough UDP to external clients ? Port Forwarding is not that bad option (although is limited in the amount of PODs I can expose trough single public ip, at least I think so). 
What I'd like to achive is to either connect client directly to server, or route client traffic to particular POD (ie router->service->pod scenario is acceptable, but the less indirection the better).</p>

<p>I have read this:
<a href="http://www.compoundtheory.com/scaling-dedicated-game-servers-with-kubernetes-part-1-containerising-and-deploying/" rel="nofollow noreferrer">http://www.compoundtheory.com/scaling-dedicated-game-servers-with-kubernetes-part-1-containerising-and-deploying/</a>
And it is nice source on information although I'm not sure if the server is connected trough UDP (which is must have requirement for me). Or how exactly does unity client connect directly to internal POD IP.</p>

<p>I suggest you to take a look on Ingresses controller, 
I know that the Nginx one support UDP routing.</p>

<p>So, you expose Nginx-ingress with load-balancer IP and you create UDP configmap to route directly on your pods. </p>

<p>You should give it a try. </p>

<p><a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/udp" rel="nofollow noreferrer">https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/udp</a></p>
