oracle / oci-cloud-controller-manager

Kubernetes Cloud Controller Manager implementation for Oracle Cloud Infrastructure
Apache License 2.0
136 stars 86 forks source link

Associate service with existing Load Balancer OCID #215

Open owainlewis opened 6 years ago

owainlewis commented 6 years ago

An internal request was raised for the ability to associate a service with an existing OCI Load Balancer OCID. This ticket is to track discussion on the feature.

simonlord commented 6 years ago

I think this makes sense for a micro services style api service, it would get quite expensive to have an LB for every micro service, although really users probably would want path based LB routing which i don't think we have yet? So they'd have to do it on port - not as common but i have seen it. Obviously by re-using an LB you're putting more eggs in your basket...

owainlewis commented 6 years ago

To support path based routing we'd need to use an ingress controller. This change would be to allow a user to use an existing load balancer with a service object.

prydie commented 6 years ago

This is actually possible now with a little hackery if you're willing to change the display name of your load balancer I believe:

  1. Create a Service type=NodePort
  2. Record its .metadata.UID
  3. Update the display name of the load balancer to match the UID (plus any prefix)
  4. Change the Service to be Service type=LoadBalancer
  5. It should then use your existing load balancer.

There is work going on upstream (see: https://github.com/kubernetes/kubernetes/pull/66589) around load balancer naming which might affect this discussion.