<p>I have a small ec2 backed (not eks) k8s cluster (version 1.23.1), running in aws with 1 master and 1 worker node. The cluster has a few services, one of which is a simple front end built on flask. I am able to expose the flask app publicly using a node port service with out any issues. But I cant seem to get my load balancer to work correctly.</p>
<p><strong>flask app deployment:</strong></p>
<pre><code>kind: Deployment
metadata:
  name: app-ui
  labels:
    app: ui
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ui
  template:
    metadata:
      labels:
        app: ui
    spec:
      containers:
      - name: app-ui
        image: **image removed**
        ports:
          - containerPort: 5000
      imagePullSecrets:
      - name: docker-hub
</code></pre>
<p><strong>Node port (working):</strong></p>
<p>With this node port I can hit the app using {{worker_public_ip}}:30000</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: app-ui-nodeport
spec:
  type: NodePort
  selector:
    app: ui
  ports:
  - protocol: TCP
    port: 5000
    targetPort: 5000
    nodePort: 30000
</code></pre>
<p><strong>Load balancer (not working)</strong></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: app-ui-loadbalancer
spec:
  type: LoadBalancer
  selector:
    app: ui
  ports:
  - protocol: TCP
    port: 5000
    targetPort: 5000
</code></pre>
<p><strong>Description of the load balancer</strong></p>
<pre><code>Name:                     app-ui-loadbalancer
Namespace:                default
Labels:                   &lt;none&gt;
Annotations:              &lt;none&gt;
Selector:                 app=ui
Type:                     LoadBalancer
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.109.158.206
IPs:                      10.109.158.206
Port:                     &lt;unset&gt;  5000/TCP
TargetPort:               5000/TCP
NodePort:                 &lt;unset&gt;  32343/TCP
Endpoints:                10.244.1.46:5000
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   &lt;none&gt;
</code></pre>
<p>Please correct me if im wrong. I thought this would create an actual load balancer in aws. Then using the public ip of that load balancer I would be able to hit the app on port 5000.</p>

kayduh
<p><code>kubectl describe service app-ui-loadbalancer</code> might tell you more about what's going on. Specifically, check the <code>Events</code> section. Perhaps you might need to add a firewall rule or it's error trying to get an IP.</p>
