-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple service resources in a ServiceBinding
injected as a single logical service
#120
Comments
This could be an extension with clarity about how the Multiple ServicesDevelopers may require applications to connect with multiple services. This extension allows a If the The Here is an example:
|
Baiju, as per your proposal, would an implementor need to support both spec.service and spec.services then? |
@sbose78 the best way to experiment with this behavior, and get the semantics right, is to create a new resource whose sole purpose is to expose a synthetic provisioned service from multiple resources. If that new resource exposes the Provisioned Service duck-type, then a ServiceBinding can consume it natively. In general, I believe the ServiceBinding resource already does too much, and should be simpler. More advanced (and specialized) behavior can be layered on top by other resources. There's certainly a balance to strike between many focused resource and a single über binding resource.
@baijum Spec extensions cannot change the shape of the ServiceBinding resource without breaking conformance with the core spec. They can add new behavior within the schema of the current resource, but not change that schema. |
Yes, that was the idea. But based on the feedback from @scothis, changing the MultiserviceDevelopers will require applications to connect with more than one service. Creating distinct
This extension provides a Provisioned Service called When the Resource Type Schema
Multiservice Example Resource
Service Binding with Multiservice Example
|
hey @sbose78 - I really like the scope you defined by:
@baijum - with that in mind perhaps the name should be something like |
I changed it to |
Is the intent of the Assuming the former is the intent, I have a few thoughts:
If the later is the intent:
|
After thinking some more on this and seeing the previous comment from @scothis I But I don't have a clear answer to this question he raised:
If we just join all the services' secret keys, there is a chance for name collision. Another option is to use some prefix, probably the name of the service, or introduce another attribute as @sbose78 mentioned in the description. |
Discussed this during interlock. There are still open questions about conflicting key/value pairs in the binding secrets. |
Labelling as RC3 for now. |
Ah, missed responding to Scott. Sorry! We could support three scenarios
|
hi folks. One idea would be to include a This way we don't need the additional CRD, and helps users understand that this is just for related CRs, not unrelated services (which should be a separate |
Based on the proposal in #145, I think we can create
As you can see above, these are well-defined mappings without any ambiguity. This extension will help us during the early days where users do not want to create a Direct Secret Reference with fixed values. Once the world is full of Provisioned Service resources, probably the importance of this extension will go away! |
I like the ComposedService example, but we should strive to avoid the mappings. I'd like to see clear precedence rules (either first wins, or last wins) to make the order of services significant, and reserve mappings for exceptions.
services:
- apiVersion: com.example/v1alpha1
kind: AccountService
name: prod-account-service
- apiVersion: v1
kind: Secret
name: prod-account-service With |
I like the idea of defining a set of precedence rules, but I wonder if this imposes restrictions on the implementations to use libraries that guarantee the order of array elements? |
Structurally, arrays have an order by definition. Sometimes the semantic use of an array ignores the ordering, but that's always defined at the semantic layer. A library that don't respect the order of an array sounds like a chaos generator. |
Based on the recent discussion, I wrote this draft extension. Composed ServiceThere are scenarios where an appropriate resource conforming to the Provisioned Service duck-type does not exist, and using a Direct Secret Reference with fixed values is not desirable. In some cases, it is possible to extract all the required binding values from multiple Provisioned Services (including The Composed Service describes composing multiple Provisioned Service-able resources to form a coherent Provisioned Service that can be used for Service Binding. It MUST be codified as a concrete resource type conforming to the Provisioned Service duck-type with version A Composed Service resource MUST define a Resource Type SchemaapiVersion: mapping.service.binding/v1alpha2
kind: ComposedService
metadata:
name: # string
spec:
services: # []Service (Povisioned Service-able resource)
- apiVersion: # string
kind: # string
name: # string
mappings: # []Mapping, optional
- name: # string
service: # string
key: # string
status:
binding: # LocalObjectReference
name: # string Minimal Example ResourceapiVersion: mapping.service.binding/v1alpha2
kind: ComposedService
metadata:
name: composed-service
spec:
services:
- apiVersion: com.example/v1alpha1
kind: AccountService
name: prod-account-service
- apiVersion: v1
kind: Secret
name: credentials
mappings:
- name: username
service: credentials
key: username
- name: password
service: prod-account-service
key: passwd
status:
binding:
name: prod-account-composed-service Reconciler ImplementationA reconciler implementation MUST merge the |
If the intention is to aggregate bindings from provisioned services only, how about that A few additional questions/concerns:
Otherwise, the idea looks good. There is however a usecase that is not covered by the proposed resources and I really like @arthurdm idea proposed earlier in the thread:
Namely, we see quite often operators (e.g. Crunchy Postgres) that provision write credentials (username/password) in a separate secret not linked to servcice CR anyhow. Ofcourse, we should help them to make migrate to the provision service approach, but until then, it would be really helpful to have a way to define several resources related to the service and create single binding secret eventually. For example: service:
apiVersion: "foo.bar/v1"
kind: "Database"
name: "db1"
additionalResources:
- apiVersion: v1
lond: Secret
name: db1-credentials
|
what's the proposed behavior for the |
I have implemented something similar here: |
I made this project private as I couldn't continue to work on it. If anyone looking at this, this is my proposed resource looks like:
|
Hello folks!
May I propose that we allow the
ServiceBinding
resource to have multiple service objects, which would be projected into an application as a single logical service "account-database" ?The injection could still happen under one logical service given that the intent of the list of services isn't to have multiple distinct logical services, rather the intent is to construct a single binding secret from multiple service objects.
As already proposed in this specification, if the user wishes to add another backing service, the user may create a new
ServiceBinding
for a "different-service" and that would provide the following projection:The above proposal would enable one to use
ServiceBinding
without forcing the backing service ( or the application ?) to undergo changes.The text was updated successfully, but these errors were encountered: