<p>I have the following services hosted in my Kubernetes cluster on AWS.</p>

<ul>
<li>An nginx server, on ports 80 and 443.</li>
<li>A Minecraft server, at port 25565.</li>
</ul>

<p>Both are working great. I currently have both of them set to <code>type: LoadBalancer</code>, so they both have Elastic Load Balancers that are providing ingress to the cluster. </p>

<p>I would like to have only one ELB -- they cost money, and there's no reason not to have the Minecraft server and the HTTP(S) server on the same external IP.</p>

<p>I tried to create a service without a selector, then tried to manually create an Endpoints object referencing that service, but it doesn't appear to be working. <a href="https://gist.github.com/iameli/1c8f82ecabeeacb870a3" rel="noreferrer">Here's the setup on a gist</a>. When I try and <code>curl</code> on the allocated <code>nodePort</code> from inside the cluster it just hangs.</p>

<p>Is there a way to have one service balance to multiple services?</p>

<p>The Ingress resource, which was added in version 1.1.0, was designed specifically for this use case. It allows you to put multiple services behind a single IP address, routing to them based on HTTP path. Check out <a href="https://github.com/kubernetes/kubernetes/blob/release-1.1/docs/user-guide/ingress.md" rel="noreferrer">the user guide on it</a> for more details, but feel free to ask if you have more questions about it!</p>

<p>edit: For a non-HTTP(S) service, you can have to find a way to make sure all necessary ports get load balanced by the ELB and then properly routed by Kubernetes. On GCE, you could manually create the load balancer with the ports you need, and then put the load balancer's IP in the <code>externalIPs</code> field for each service. My memory's a little fuzzy, but I don't believe that'll work with an ELB due to its packet rewriting. You might instead want to create each service as a <code>NodePort</code> service, then configure your ELB to forward the packets from the correct external port to the node port for each service.</p>
