<p>I am new to Kubernetes. I followed <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way" rel="nofollow noreferrer">Kubernetes the hard way</a> from Kesley Hightower and also <a href="https://github.com/ivanfioravanti/kubernetes-the-hard-way-on-azure" rel="nofollow noreferrer">this</a> to set up Kubernetes in Azure. Now all the services are up and running fine. But I am not able to expose the traffic using Load balancer. I tried to add a <code>Service</code> object of type <code>LoadBalancer</code> but the external IP is showing as <code>&lt;pending&gt;</code>. I need to add ingress to expose the traffic.</p>

<p>nginx-service.yaml</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  labels:
    app: nginx-service
  name: nginx-service
spec:
  type: LoadBalancer
  externalIPs:
    - &lt;ip&gt;
  ports:
    - name: "80"
      port: 80
      targetPort: 80
    - name: "443"
      port: 443
      targetPort: 443
  selector:
    app: nginx-service
</code></pre>

<p>Thank you,</p>

Manoj Kumar Maharana
<p>By default, the solution proposed by Kubernetes The Hard Way doesn't include a solution for LoadBalancer. The fact it's pending forever is expected behavior. You need to use out-of-the box solution for that. A very commonly used is <a href="https://metallb.universe.tf/" rel="nofollow noreferrer">MetalLB</a>.</p>

<p>MetalLB isn't going to allocate an External IP for you, it will allocate a internal IP inside our VPC and you have to create the necessary routing rules to route traffic to this IP. </p>
