<p>I am trying to deploy nginx on kubernetes, kubernetes version is v1.5.2,
I have deployed nginx with 3 replica, YAML file is below,</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: deployment-example
spec:
  replicas: 3
  revisionHistoryLimit: 2
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.10
        ports:
        - containerPort: 80
</code></pre>
<p>and now I want to expose its port 80 on port 30062 of node, for that I created a service below,</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
  name: nginx-ils-service
spec:
  ports:
    - name: http
      port: 80
      nodePort: 30062
  selector:
    app: nginx
  type: LoadBalancer
</code></pre>
<p>this service is working good as it should be, but it is showing as pending not only on kubernetes dashboard also on terminal.
<a href="https://i.stack.imgur.com/ix5v1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ix5v1.png" alt="Terminal output" /></a><a href="https://i.stack.imgur.com/TUMOB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TUMOB.png" alt="Dash board status" /></a></p>

Pankaj Jackson
<p>It looks like you are using a custom Kubernetes Cluster (using <code>minikube</code>, <code>kubeadm</code> or the like). In this case, there is no LoadBalancer integrated (unlike AWS or Google Cloud). With this default setup, you can only use <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="noreferrer"><code>NodePort</code></a> or an Ingress Controller.</p>

<p>With the <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class" rel="noreferrer">Ingress Controller</a> you can setup a domain name which maps to your pod; you don't need to give your Service the <code>LoadBalancer</code> type if you use an Ingress Controller.</p>
