<p>I running a kubernetes LB but the external ip says &quot;pending&quot;, looks like it is trying to get a IP but, I need it as &quot;localhost&quot; to access it in my browser:</p>
<p>What do I miss?</p>
<pre><code>NAME                 TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
service/dev-pypi     LoadBalancer   10.106.128.15   &lt;pending&gt;     80:30914/TCP     2m7s
service/kubernetes   ClusterIP      10.96.0.1       &lt;none&gt;        443/TCP          47h
service/qa-pypi      LoadBalancer   10.97.62.94     &lt;pending&gt;     8200:30114/TCP   94m
</code></pre>
<p>Thanks in advance.
This is my yaml file:</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
  name: qa-pypi
spec:
  type: LoadBalancer
  selector:
    app: pypi-qa
  ports:
  - protocol: TCP
    port: 8200
    targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: qa-pypi
  labels:
    app: pypi-qa
spec:
  replicas: 2
  selector:
    matchLabels:
      app: pypi-qa
  template:
    metadata:
      labels:
        app: pypi-qa
    spec:
      containers:
      - name: pypi-qa
        imagePullPolicy: IfNotPresent
        image: myimg2
        ports:
        - containerPort: 8080
        volumeMounts:
            - name: storageqa
              mountPath: /app/local
      volumes:
        - name: storageqa
          persistentVolumeClaim:
            claimName: persistvolumeqa
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: persistvolumeqa
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
</code></pre>
<p>Thank you !!!!!!!!!!!!!!!!!!!!</p>

Rafa Valverde
<p>You already have here a lot of advises how to use <code>localhost</code>, what you can do with <code>NodePort</code>. Let me fill the gap and explain why you see <code>Pending</code> state.</p>
<p>Look, minikube itself, doesnt allocate and provide you <code>LoadBalancer</code> ip-address. <code>LoadBalancer</code> service type is widely used in cloud implementations, like EKS, AKS, GKE and others. Because cloud service providers create you loadbalancer in the background as soon as you chose this type.</p>
<p>If you want to use <code>LoadBalancer</code> with minikube you should  configure minikube first. What you can do is use built-in <a href="https://metallb.universe.tf/" rel="nofollow noreferrer">metallb</a> minikube addon.</p>
<blockquote>
<p>MetalLB had addressed the gap and provides the network LoadBalancer
implementation as an addon.</p>
</blockquote>
<p>During metallb installation and configuration you are able to set the range og local ip-adressed that would be assigned to <code>LoadBalancer</code> service instead of <code>Pending</code> state</p>
<p>If you want to know more about this and check real example of configuration - check for example <a href="https://medium.com/faun/metallb-configuration-in-minikube-to-enable-kubernetes-service-of-type-loadbalancer-9559739787df" rel="nofollow noreferrer">MetalLB Configuration in Minikube — To enable Kubernetes service of type “LoadBalancer”</a> article</p>
