Kubernetes external ip loadbalancer bare metal

10/5/2015

is there a way to setup automatic external ip allocation to service like google do in loadbalancer ? I'm running kubernetes on bare metal.

Thank you

-- Julien Du Bois
kubernetes

2 Answers

9/12/2018

Using services of type nodePort , Kubernetes will expose the service on a port on all the cluster nodes.

But with each deployment the ports will be different , dynamic , if you don't specify it manually , the best practice is to use dynamic ports , but implement a service discovery feature ( bash or python script ) in your custom external load balancer to keep discovering the ports on Kubernetes service API ,based on the service name.

-- Ijaz Ahmad Khan
Source: StackOverflow

10/5/2015

Use services with type nodePort, it will bind your service to a fixed port on all your nodes (http://kubernetes.io/v1.0/docs/user-guide/services.html#type-nodeport)

Then you have to use a loadbalancer (i.e haproxy) to forward calls to this service.

The loadbalancer configuration can be done by a script that use kubernetes /services API.

-- ant31
Source: StackOverflow