<p>I am new to Kubernetes and was testing a sample deployment. The following is the output from the kubectl get services command. After I deployed the application thru a deployment yml it completes successfully and the pods are provisioned. Now I go to <code>EXTERNAL-IP:80</code> but I don't get a response and the page keeps spinning.</p>

<pre><code>NAME                    TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)        AGE
demotest2               LoadBalancer   XX.X.XX.XX     XX.XXX.XXX.XX   80:30904/TCP   35m
</code></pre>

<p>Please let me know if I need to provide more information.</p>

2713
<p>From the message you provided, there are two possible reasons. <strong>One</strong> is that the pod of your deployment does not run well. It means your image which hosts your application does not work as you want. For this, you need to check if your image can work well locally. Another one is that the <code>demotest2</code> service does not route the request to the pod of your deployment. For this, you need to check if the <code>selector</code> of the service was set correctly for your pod.</p>

<p><strong>For example:</strong></p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  selector:
    matchLabels:
      run: nginx1
  replicas: 1
  template:
    metadata:
      labels:
        run: nginx1
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  type: LoadBalancer
  ports:
  - name: test1
    port: 80
    targetPort: 80
  selector:
    run: nginx1
</code></pre>

<p>In this example, the pods of the deployment use the label <code>run: nginx1</code>, so you need to set the <code>selector</code> of the service as <code>run: nginx1</code>.</p>
