-
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
Create Mappings Extension #145
Comments
My opinion is that A new resource similar to the In some ways this is the reverse of the binding secret generation strategies, which may be good for cases where the source service's community has no interest in updating their CR. I think it would be helpful to have, as an extension, at least one of such synthetic mappers (CRD for JSONPath makes sense), so that there's some level of interoperability between opted-in implementations. For example: if we have a |
Do you see value in having different implementations of spec'd mappers? If there are semantic differences in the mapper that would justify distinct implementations, then the value (portability) of them being spec'd is lessened. |
I think the implementations would be the same - or at least yield the exact same result. |
I think I would like option 2.5 😄 Have a single CRD for mapping in the extension part of the spec - so it's not required, but if supported by a vendor it will be consistent. An example (morphed from @nebhale 's examples) of a CR:
So the type of supported template is push into |
I believe the "single resource type, multiple |
good point @nebhale - I haven't thought about the reconciler implications. My preference is for a spec extension to define a set of popular CRDs (JSONPath and Go templates may be good ones to start with, with their unique |
Hi @nebhale, thanks for including me in this discussion! #151 proposes to be able to define static values in the
This seems be a requirement for almost all In this proposal, as you mentioned, this would be addressed in the following way:
In this solution, the knowledge required to bind a
Whereas with #151, the problem would be addressed by creating a regular ServiceBinding:
Therefore, when considering this use case, as a developer, I would rather use the approach described in #151 than the one described here. To circle back to the original issue of Beyond "Go templates" use cases, I think the mapping problem should be the responsibility of the application itself. For example, in Java, frameworks, such as Quarkus or Spring, will already read binding properties for you and create Database connections or Kakfa connections with the specification as it is today. This is where the "mapping" between binding properties to service connections is done. You also added concerns about interoperability (which I share). That and the added complexity this adds to create a At the very least, I think #151 and #145 should be treated separately? Let me know what you think, Thanks ! ps: sorry for the long post... |
The existing mappings on the ServiceBinding resource were introduced as a way to make it easier for a user to enrich an existing Secret into a form appropriate for binding to an application workload. This approch had a few issues that can be better addressed by other resources that interoperate with the ServiceBiding resource. The issues include: - the ServiceBinding controller needs to be able to read and write Secrets - Go templates were used to compose new values, which worked for basic templating, but were limited in their capabilities - the capabilities of the Go templates are an implemenation detail of how the controller is built and could change over time independent of the speced behavior. The behavior applied by mappings can be reintroduced as dedicated resources that can themselves expose a Secret as a ProvisionedService, which can be consumed by a ServiceBinding. This change further separates the concerns of provisioning a service from binding a service. Refs servicebinding#145 Signed-off-by: Scott Andrews <[email protected]>
The first half of this move (the removal from the core spec) has been completed. The issue is open to track the creation of one or more extension specifications that contain the removed functionality. |
I proposed a mapping extension: #221 |
Currently, the
ServiceBinding
type contains amappings
element that allows the creation of mappings from the contents of aProvisionedService
’sSecret
to a newSecret
projected into an Application. The inclusion of this element, while reducing the number of resources that a user might need to create, had some significant downsides.ServiceBinding
reconciler needed to have permissions to read existingSecrets
.ServiceBinding
reconciler and ensure that only a single implementation was installed.Proposal
The mapping element should be removed from the
ServiceBinding
resource and its functionality should be moved into a set of discrete resource types devoted to this mapping. For example, instead of defininga user would define multiple resource types
Benefits
This change would immediately improve the permissions situation removing the need for the
ServiceBinding
reconciler to have permissions to readSecrets
. Instead a user could elect whether to add mapping behavior or not based on whether they felt the value/risk of having a third-party controller with access toSecret
s was worth it.If the user wanted mappings, but didn’t trust our implementation this change also provides a point of extensibility allowing a user to install another implementation that they trust more or even implement a mapping reconciler themselves.
That extensibility isn’t just beneficial to users concerned with security either. This same point of extensibility also allows the introduction of an arbitrary number of mapping syntaxes. While we might have implementations for OLM, Go V1 Templates, and more, the project wouldn’t be gatekeepers for platform-specific or user-specific templating syntaxes. Each user could implement or install a mapping controller that suited their needs.
A design that moves mappings out so that they are just another implementation of the
ProvisionedService
duck type also results in architectural benefits. It improves the separation of concerns (ServiceBinding
only cares about performing the binding, not also doing an inline mapping), it simplifies the mapping of the most critical controller, and it enables composability of mappings.Finally by moving this feature, for which each platform has diverging needs, out of the reference implementation it reduces the need to have multiple implementations of the specification which reduces the possibility of collisions within a given cluster.
Outcomes
There are a couple of options for what happens to the mapping functionality after it is extracted.
First, it could become a purely community concern. Each platform vendor would be free to implement their own controllers for their own mapping styles. This option provides ultimate flexibility at the expense of interoperability.
Second, a set of mapping types could be included in the project implementation, but not as part of the specification. This would not preclude vendors from adding their own mapping styles in their platforms. This option maintains much of the flexibility of the previous option while adding some level of interoperability for commonly used mapping needs.
Third, a set of mappings could be included in the specification as well as in the implementation of the specification. This would not preclude vendors from adding their own mapping styles in their platforms. This option creates the highest level of interoperability at the expense of flexibility.
The text was updated successfully, but these errors were encountered: