<p>I am trying to expose a service to the outside world using the <code>loadBalancer</code> type service.</p>

<p>For that, i have followed this doc </p>

<p><a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-kubernetes-services-cluster/" rel="noreferrer">https://aws.amazon.com/premiumsupport/knowledge-center/eks-kubernetes-services-cluster/</a></p>

<p>My <code>loadbalancer.yaml</code> looks like this </p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  type: LoadBalancer
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
</code></pre>

<p>But the load balancer is not creating as expected I am getting the following error</p>

<pre><code>Warning  SyncLoadBalancerFailed  8s (x3 over 23s)  service-controller  Error syncing load balancer: failed to ensure load balancer: could not find any suitable subnets for creating the ELB
</code></pre>

<p>Seems like its because of some issues in the subnet tags to solve,but i have the required tags in my subnets</p>

<pre><code>kubernetes.io/cluster/&lt;cluster-name&gt;. owned  
kubernetes.io/role/elb   1
</code></pre>

<p>But still, I am getting the error <code>could not find any suitable subnets for creating the ELB</code></p>

shamon shamsudeen
<p>By default AWS EKS only attaches load balancers to public subnets. In order to launch it in a private subnet you need to not only label your subnets (which it looks like you did) but also annotate your load balancer-</p>

<blockquote>
  <p>service.beta.kubernetes.io/aws-load-balancer-internal: "true"</p>
</blockquote>

<p>You can find more information <a href="https://docs.aws.amazon.com/eks/latest/userguide/load-balancing.html" rel="noreferrer">here</a>.</p>
