<p>I am running a simple web application inside pods and have mapped them with load balaner. I was able to <code>curl</code> it from the ec2 machine but couldn't access it from outside. Am I missing something in configuration?. Here is my deployment and service yml.</p>
<p><strong>Service</strong></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: load-balancer-service
spec:
  type: LoadBalancer
  selector:
    tag: frontend
  ports:
  - name: port-lb-k8s
    protocol: TCP
    port: 8080
    targetPort: 80
</code></pre>
<p><strong>Deployment</strong></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend-deployment
spec:
  selector:
    matchLabels:
      tag: frontend
  replicas: 3 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        tag: frontend
    spec:
      containers:
      - name: frontend-container
        image: coitlearning/coit-frontend
</code></pre>
<p><strong>Ec2 Machine</strong></p>
<p><a href="https://i.stack.imgur.com/KPSUw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KPSUw.png" alt="enter image description here" /></a></p>

Jitender
<p>In-order to create a service with an internet-facing Network Load Balancer that load balances to IP targets, you can use the following</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: nlb-load-balancer-service
  namespace: default
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-type: external
    service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
    service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
spec:
  ports:
    - port: 8080
      targetPort: 80
      protocol: TCP
  type: LoadBalancer
  selector:
    tag: frontend
</code></pre>
<p>You can get more details in <a href="https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html" rel="nofollow noreferrer">official-docs</a></p>
