# Loadbalancer service in AWS EC2 instances without using AKS

**URL:** <https://discuss.kubernetes.io/t/loadbalancer-service-in-aws-ec2-instances-without-using-aks/8403>\
**Category:** General Discussions\
**Created:** [October 21, 2019, 5:37pm UTC](https://discuss.kubernetes.io/t/loadbalancer-service-in-aws-ec2-instances-without-using-aks/8403 "2019-10-21T17:37:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guru\_Prashanth\_Thana](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/guru_prashanth_thana/32/3938_2.png) [@Guru\_Prashanth\_Thana](https://discuss.kubernetes.io/u/Guru_Prashanth_Thana)\
**Post date:** [October 21, 2019, 5:37pm UTC](https://discuss.kubernetes.io/t/loadbalancer-service-in-aws-ec2-instances-without-using-aks/8403/1 "2019-10-21T17:37:21Z")

</div>

Asking for help? Comment out what you need so we can get more information to help you!

### Cluster information:

Kubernetes version: 1.16  
Cloud being used: baremetal  
Installation method: kubeadm  
Host OS: Ubuntu  
CNI and version:docker 1.8.06  
CRI and version:

I have a two node EC2 instance in Amazon. I am not using Amazon kubernetes service. it’s just a kubeadm installation. I want to create a load balancer for one of the micro service. But the state of this service is in pending state and it’s not creating a load balancer. There are no kubernetes related logs in /var/log older. Journalctl logs are not showing anything. I have added the required tags for the subnet. Is it really possible to do this configuration? I went through the documentation in the “[Service - Kubernetes](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer)” but doesn’t state if I have to use the cloud provider’s kubernetes service. Could some please clarify this?

Tags added to subnet:  
`kubernetes.io/role/internal-elb`  
[kubernetes.io/cluster/](http://kubernetes.io/cluster/) owned

```
apiVersion: v1
kind: Service
metadata:
  name: netappcrouinodeport
  annotations:
   service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
  labels:
    app: ndas
    tier: frontend
spec:
  type: LoadBalancer
  ports:
  - port: 8082
    targetPort: 8082
  selector:
    app: ndas
    name: netappcro-pod
    tier: frontend
```

---

<div class="post-metadata">

**Author:** ![rata](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/rata/32/18244_2.png) [@rata](https://discuss.kubernetes.io/u/rata)\
**Post date:** [October 21, 2019, 6:15pm UTC](https://discuss.kubernetes.io/t/loadbalancer-service-in-aws-ec2-instances-without-using-aks/8403/2 "2019-10-21T18:15:40Z")

</div>

Yes, It is really possible 🙂

Probably there was a flag missing specifying which cloud provider is being used. The kubelet and several components have a --cloud-provider flag that should be set to AWS for that to work.

Is it possible that currently the components don’t have it? Can you check that?

---

<div class="post-metadata">

**Author:** ![Guru\_Prashanth\_Thana](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/guru_prashanth_thana/32/3938_2.png) [@Guru\_Prashanth\_Thana](https://discuss.kubernetes.io/u/Guru_Prashanth_Thana)\
**Post date:** [October 22, 2019, 2:10am UTC](https://discuss.kubernetes.io/t/loadbalancer-service-in-aws-ec2-instances-without-using-aks/8403/3 "2019-10-22T02:10:43Z")

</div>

Thanks for confirming. I will add those flags and try it.

---

<div class="post-metadata">

**Author:** ![JaviSoriano](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@JaviSoriano](https://discuss.kubernetes.io/u/JaviSoriano)\
**Post date:** [September 21, 2024, 10:12pm UTC](https://discuss.kubernetes.io/t/loadbalancer-service-in-aws-ec2-instances-without-using-aks/8403/4 "2024-09-21T22:12:35Z")

</div>

Hi Guru! I am trying to do the same as you did a few years ago. Setting up a Kubernetes cluster with EC2 and a load balancer. Did you manage to resolve this issue, and if so could you be so kind to show me how to do it ? Best, Javier
