<p>For testing I created Kubernetes on single node by using Virtualbox.
I created one Pod listening on port 4646, then I created LoadBalancer for that Pod.</p>

<p>Yaml file for Pod:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: simple-app
  labels:
    app: simple-app
spec:
  containers:
    ...
    name: test-flask-app
    ports:
    - containerPort: 4646
</code></pre>

<p>Yaml file for LoadBalancer:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: simple-app-lb
spec:
  type: LoadBalancer
  ports:
  - port: 88
    protocol: TCP
    targetPort: 4646
  selector:
    app: simple-app
</code></pre>

<p>Output of command <code>kubectl get nodes -o wide</code>:</p>

<pre><code>NAME     STATUS   ROLES    AGE   VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
server   Ready    master   20h   v1.14.1   10.0.2.8      &lt;none&gt;        Ubuntu 18.04.2 LTS   4.15.0-48-generic   docker://18.6.2
</code></pre>

<p>Output of command <code>kubectl get all</code></p>

<pre><code>NAME             READY   STATUS    RESTARTS   AGE
pod/simple-app   1/1     Running   5          20h

NAME                    TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
service/kubernetes      ClusterIP      10.96.0.1      &lt;none&gt;        443/TCP        20h
service/simple-app-lb   LoadBalancer   10.98.241.39   &lt;pending&gt;     88:32319/TCP   20h
</code></pre>

<p>On other virtual machine that is located in the same network I'd like to get an access to LoadBalancer by IP address of machine with Kubernetes and by port 88. If I run the next command I get the output below:</p>

<pre><code>sergey@server2:~$ curl 10.0.2.8:88
curl: (7) Failed to connect to 10.0.2.8 port 88: connection refused
</code></pre>

<p>But if I use port 32319 I get the access:</p>

<pre><code>sergey@server2:~$ curl 10.0.2.8:32319
{"msg":"superuser, Hello from GeoServer"}
</code></pre>

<p>Also I can get the access if I am on the machine with Kubernetes:</p>

<pre><code>sergey@server:~$ curl 10.98.241.39:88
{"msg":"superuser, Hello from GeoServer"}
</code></pre>

<p>What reasons cause that I can't get the access by EXTERNAL-IP and PORT?</p>

sergiusac
<p>Under the hood Load Balancer service is also a NodePort, that's why you can connect to NodeIP:32319. You can read more about NodePort services here: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#nodeport</a></p>

<p>Also you should see that your LoadBalancer External IP is forever in Pending state, which means no real Load Balancer was created. Because you are not running in cloud and there is no provider for Load Balancer. So in your case you can access Load Balancer service only by ClusterIP:88 from Kube nodes or by NodeIP:32319 from outside of Kubernetes cluster.</p>
