<p>I have a kubernetes cluster installed.
I want to use an external database ( out of my cluster ) for one of my microservices but this external db is set as a cluster and does not have it's own load balancer.</p>

<p>is there a way to create an internal loadbalancer service that will allow kubernetes to always direct the microservices to the running instance?</p>

<p>I saw that you can set a service of type loadbalancer,how can I use it?
I tried creating it but I saw the loadbalancer service was created with NodePort. can it be used without a NodePort?</p>

<p>many thanks</p>

eran meiri
<p>You cannot, as far as I'm aware, have a Kubernetes service healthcheck an external service and provide loadbalancing to it.</p>

<p>The Service of type=LoadBalancer refers to cloudproviders' LoadBalancers, like ELB for AWS. This automates the process of adding NodePort services to those cloud provider LoadBalancers.</p>

<p>You may be able to get the solution you require using a service mesh like <a href="https://istio.io/" rel="nofollow noreferrer">Istio</a> but that's a relatively complex setup.</p>

<p>I would recommend putting something like <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-highly-available-haproxy-servers-with-keepalived-and-floating-ips-on-ubuntu-14-04" rel="nofollow noreferrer">HAProxy/KeepAliveD</a> of <a href="http://www.linuxvirtualserver.org/software/ipvs.html" rel="nofollow noreferrer">IPVS</a> in front of your database</p>
