Dubs
Dubs

Reputation: 666

Kubernetes external ip loadbalancer bare metal

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

Upvotes: 6

Views: 1924

Answers (2)

Ijaz Ahmad
Ijaz Ahmad

Reputation: 12100

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.

Upvotes: 0

ant31
ant31

Reputation: 4760

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.

Upvotes: 2

Related Questions