servicebinding / spec

Specification for binding services to k8s workloads
https://servicebinding.io
Apache License 2.0
92 stars 35 forks source link

Label selector for services #169

Closed arthurdm closed 3 years ago

arthurdm commented 3 years ago

I've come across a scenario where an application needs to use a service, but there could be many instances of that service (with different configurations), dynamically added anytime before or after the application is up and running.

Depending on the request that comes into the application it would need to call a different instance of the service, so the ideal scenario would be for the application to have all of the available service instances mounted so it can browse through them and call the correct one.

If we added a labelSelector to the ServiceBinding.spec.service element we could achieve this, since all of the service instances would share a common label.

Otherwise I would need to create a way (probably another CR) that declares the binding intent from my app to any instance of the given service, and have some processor dynamically create a new ServiceBinding CR for each service instance that comes in.

scothis commented 3 years ago

There are a few impacts of this change that should be considered:

scothis commented 3 years ago

Otherwise I would need to create a way (probably another CR) that declares the binding intent from my app to any instance of the given service

This seems like the right move. In the same way that Deployments orchestrate the rollout of ReplicaSets

baijum commented 3 years ago

From yesterday's meeting:

arthurdm commented 3 years ago

Closing in favour of #184