servicebinding / spec

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

Adding label selectors for services #186

Open arthurdm opened 2 years ago

arthurdm commented 2 years ago

This issue proposes a new approach (different than #184 and #179) where you would be able to use label selectors for services in the ServiceBinding CR itself.

Here's an illustration of the desired outcome:

apiVersion: service.binding/v1alpha2
kind: ServiceBinding
metadata:
  name: my-binding
spec:
  service:
    apiVersion: com.example/v1
    kind: Database
    selector:
      matchingLabels:
        app: my-db
  workload:
    apiVersion: apps/v1
    kind: Deployment
    name: online-banking

The behaviour from the controller is such that:

arthurdm commented 2 years ago

btw - this is for after our 1.0 GA.

baijum commented 2 years ago
  • one idea can be to disallow environment variables if a service label selector is used.

I would prefer this approach to disable environment variables to avoid any name conflict. This is important for the proposal that I created in the issue https://github.com/servicebinding/spec/issues/136#issuecomment-862621664.