<p>I create a sample setup of Kubernets cluster on Azure using Azure Container Service, and it did its job just fine. I set up several containers and services within the Kubernetes, no problem with that.</p>

<p>What makes me fuzzy is that if, say, I run <strong>several nginx containers and want to expose it via different external IPs</strong>, I can't do that for what I know and understand.</p>

<p><a href="https://learn.microsoft.com/ru-ru/azure/container-service/kubernetes/container-service-kubernetes-load-balancing" rel="nofollow noreferrer">Azure approach</a> is that I can set up Service and set <code>type: LoadBalancer</code> and as I create it Azure will "connect" LoadBalancer attached to client nodes to my service.</p>

<p>But this way I can only attach <strong>one</strong> external IP to <strong>all</strong> of my services which is not something I need. In my example when I run several nginx containers I'd like to expose its 80/tcp ports on different IPs so I can these IPs in DNS, not on different ports of the single IP.</p>

<p>How can I overcome that? <strong>Please help!</strong></p>

<p>In Azure container service, to expose a kubernetes service to Internet, we should use Azure Load balancer. As Radek said, several containers in one pod, and use the same load balancer to keep HA. </p>

<p>If you want to expose several containers to Internet with different Public IP addresses, we can create several pods, and expose them to Internet, in this way, containers with different public IP addresses.</p>

<p>The relationship about pod, containers and node, like this:
<a href="https://i.stack.imgur.com/zMvUV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zMvUV.png" alt="enter image description here"></a></p>

<p>We create several containers in one pod, several pods in one node(host), several pods work for one service. A service works as a cluster, one service with one public IP address.</p>

<p>So, if you want to create several nginx containers with different public IP addresses, we can create several services to archive this:</p>

<p>Create one or two nginx containers in one service, and expose several services to Internet.</p>

<pre><code>root@k8s-master-7273A780-0:~# kubectl run jasonnginx --replicas=1 --image nginx
root@k8s-master-7273A780-0:~# kuberctl run mynginx --replicas=2 --image nginx
root@k8s-master-7273A780-0:~# kubectl expose deployments mynginx --port=80 --type=LoadBalancer
root@k8s-master-7273A780-0:~# kubectl expose deployments jasonnginx --port=80 --type=LoadBalancer
root@k8s-master-7273A780-0:~# kubectl get svc
NAME         CLUSTER-IP     EXTERNAL-IP     PORT(S)        AGE
jasonnginx   10.0.114.116   52.168.176.18   80:30153/TCP   5m
kubernetes   10.0.0.1       &lt;none&gt;          443/TCP        15m
mynginx      10.0.205.127   13.82.102.171   80:31906/TCP   6m
root@k8s-master-7273A780-0:~# kubectl get pods
NAME                          READY     STATUS    RESTARTS   AGE
jasonnginx-1417538491-v79mw   1/1       Running   0          20m
mynginx-1396894033-78njj      1/1       Running   0          21m
mynginx-1396894033-pmhjh      1/1       Running   0          21m
</code></pre>

<p>We can find the Load balancer frontend IP settings(two public IP addresses) via Azure portal:
<a href="https://i.stack.imgur.com/plpL7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/plpL7.png" alt="enter image description here"></a></p>
