<p>Is it true that I cannot have two LoadBalancer services on a docker-desktop cluster (osx), because they would both use <code>localhost</code> (and all ports are forwarded)?</p>

<p>I created an example and the latter service is never assigned an external IP address but stays in state <code>pending</code>. However, the former is accessible on localhost.</p>

<pre><code>&gt; kubectl get all     
NAME                                       READY   STATUS    RESTARTS   AGE
pod/whoami-deployment-9f9c86c4f-l5lkj      1/1     Running   0          28s
pod/whoareyou-deployment-b896ddb9c-lncdm   1/1     Running   0          27s
pod/whoareyou-deployment-b896ddb9c-s72sc   1/1     Running   0          27s

NAME                        TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
service/kubernetes          ClusterIP      10.96.0.1       &lt;none&gt;        443/TCP        95s
service/whoami-service      LoadBalancer   10.97.171.139   localhost     80:30024/TCP   27s
service/whoareyou-service   LoadBalancer   10.97.171.204   &lt;pending&gt;     80:32083/TCP   27s

NAME                                   READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/whoami-deployment      1/1     1            1           28s
deployment.apps/whoareyou-deployment   2/2     2            2           27s

NAME                                             DESIRED   CURRENT   READY   AGE
replicaset.apps/whoami-deployment-9f9c86c4f      1         1         1       28s
replicaset.apps/whoareyou-deployment-b896ddb9c   2         2         2       27s
</code></pre>

<p>Detailed state fo whoareyou-service:</p>

<pre><code>kubectl describe service whoareyou-service
Name:                     whoareyou-service
Namespace:                default
Labels:                   &lt;none&gt;
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"whoareyou-service","namespace":"default"},"spec":{"ports":[{"name...
Selector:                 app=whoareyou
Type:                     LoadBalancer
IP:                       10.106.5.8
Port:                     http  80/TCP
TargetPort:               80/TCP
NodePort:                 http  30333/TCP
Endpoints:                10.1.0.209:80,10.1.0.210:80
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   &lt;none&gt;
</code></pre>

Daniel
<p>I decided to copy my comments, as they partially explain the problem, and make a <code>Community Wiki</code> answer out of them so it is more clearly seen and available for possible further edits by the Community:</p>

<p>It works probably exactly the same way as in <strong>Minikube</strong>. As <strong>docker-desktop</strong> is unable to provision real <code>LoadBalancer</code> it can still "simulate" creating <code>Service</code> of such type using <code>NodePort</code> (this can easily be seen from port range it uses). I'm pretty sure you cannot use same IP address as the <code>ExternalIP</code> of the <code>LoadBalancer</code> <code>Service</code> and if you create one more <code>Service</code> of such type, your <strong>docker-desktop</strong> has no other choice than to use your localhost one more time. As it is already used by one <code>Service</code> it cannot be used by another one and that's why it remains in a <code>pending state</code>.</p>

<p>Note that if you create real <code>LoadBalancer</code> in a cloud environment, each time new IP is provisioned and there is no situation that next <code>LoadBalancer</code> you create gets the same IP that is already used by the existing one. Apparently here it cannot use any other IP then one of <code>localhost</code>, and this one is already in use. Anyway I would recommend you to simply use <code>NodePort</code> if you want to expose your <code>Deployment</code> to the external world.</p>
