<p>I created a simple <strong>EKS</strong> cluster on aws as described in <a href="https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started" rel="nofollow noreferrer">https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started</a>.</p>

<p>I this cluster I created an <strong>nginx deployment</strong> and a <strong>service</strong> of type <strong>Loadbalancer</strong> as described below.
The configuration works locally on minikube.</p>

<p>On AWS I can see that pod and service are started, the service has an external ip, I can access the pod with kubectl port-forward and I can ping the LoadBalancer.</p>

<p>However I cannot access the Loadbalancer via the browser via <a href="http://a53439687c6d511e8837b02b7cab13e7-935938560.eu-west-1.elb.amazonaws.com:3001" rel="nofollow noreferrer">http://a53439687c6d511e8837b02b7cab13e7-935938560.eu-west-1.elb.amazonaws.com:3001</a><br>
I'm getting a <code>This site can’t be reached</code></p>

<p>Any idea where I should look into?</p>

<p>NGinx Deployment</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  labels:
    run: nginx
  name: nginx
  namespace: default
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      run: nginx
  template:
    metadata:
      creationTimestamp: null
      labels:
        run: nginx
    spec:
      containers:
      - image: nginx
        imagePullPolicy: Always
        name: nginx
        ports:
          - containerPort: 80
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
</code></pre>

<p>NGinx Service</p>

<pre><code>{
   "kind":"Service",
   "apiVersion":"v1",
   "metadata":{
      "name":"nginx",
      "labels":{
         "app":"nginx"
      }
   },
   "spec":{
      "ports": [
         {
           "port":3001,
           "targetPort":80
         }
      ],
      "selector":{
         "run":"nginx"
      },
      "type": "LoadBalancer"
   }
}
</code></pre>

<p>Checks</p>

<pre><code>kubectl get svc
NAME         TYPE           CLUSTER-IP      EXTERNAL-IP                                                              PORT(S)          AGE
kubernetes   ClusterIP      172.20.0.1      &lt;none&gt;                                                                   443/TCP          1h
nginx        LoadBalancer   172.20.48.112   a53439687c6d511e8837b02b7cab13e7-935938560.eu-west-1.elb.amazonaws.com   3001:31468/TCP   45m

kubectl get pod
NAME                     READY     STATUS    RESTARTS   AGE
nginx-768979984b-vqz94   1/1       Running   0          49m

kubectl port-forward pod/nginx-768979984b-vqz94 8080:80
Forwarding from 127.0.0.1:8080 -&gt; 80
Forwarding from [::1]:8080 -&gt; 80

ping a53439687c6d511e8837b02b7cab13e7-935938560.eu-west-1.elb.amazonaws.com
PING a53439687c6d511e8837b02b7cab13e7-935938560.eu-west-1.elb.amazonaws.com (62.138.238.45) 56(84) bytes of data.
64 bytes from 62.138.238.45 (62.138.238.45): icmp_seq=1 ttl=250 time=7.21 ms
</code></pre>

<p>Service description</p>

<pre><code>Name:                     nginx
Namespace:                default
Labels:                   app=nginx
Annotations:              kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"app":"nginx"},"name":"nginx","namespace":"default"},"spec":{"ports":[{"port...
Selector:                 run=nginx
Type:                     LoadBalancer
IP:                       172.20.48.112
LoadBalancer Ingress:     a53439687c6d511e8837b02b7cab13e7-935938560.eu-west-1.elb.amazonaws.com
Port:                     &lt;unset&gt;  3001/TCP
TargetPort:               80/TCP
NodePort:                 &lt;unset&gt;  31468/TCP
Endpoints:                10.0.0.181:80
Session Affinity:         None
External Traffic Policy:  Cluster
Events:
  Type    Reason                Age   From                Message
  ----    ------                ----  ----                -------
  Normal  EnsuringLoadBalancer  57m   service-controller  Ensuring load balancer
  Normal  EnsuredLoadBalancer   57m   service-controller  Ensured load balancer
</code></pre>

christian
<p>Please try the 3 steps below:</p>
<ol>
<li><p>Check again that the selectors and labels were set correctly between the Service and the Deployment.</p>
</li>
<li><p>Inside AWS, Go to &quot;<strong>Instances</strong>&quot; tab of the  Load Balancer (Probably Classic) that was created, and check the <strong>Status</strong> and <strong>Healty</strong> state of all the instances which are related to the LB:</p>
</li>
</ol>
<p><a href="https://i.stack.imgur.com/7BgZF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7BgZF.png" alt="enter image description here" /></a></p>
<p>If the status is not &quot;InService&quot; or State is not &quot;Healthy&quot; - Check the security group of those instances: <br> <strong>The NodePort (31468 in your case) should be open</strong> to accept traffic.</p>
<ol start="3">
<li>View the pod logs with <code>kubectl logs &lt;pod-name&gt;</code>.</li>
</ol>
