-
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
Remove mappings from the ServiceBinding resource #154
Conversation
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 functionality enabled by mappings can/will be replaced with dedicated resources that can decorate a secret exposing the ProvisionedService duck-type which can be consumed by a ServiceBinding. Refs servicebinding/spec#154 Signed-off-by: Scott Andrews <[email protected]>
The functionality enabled by mappings can/will be replaced with dedicated resources that can decorate a secret exposing the ProvisionedService duck-type which can be consumed by a ServiceBinding. Refs servicebinding/spec#154 Signed-off-by: Scott Andrews <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Scott Andrews <[email protected]>
Added a clarification to resolve #155 |
@@ -115,6 +114,8 @@ An implementation is not compliant if it fails to satisfy one or more of the MUS | |||
|
|||
A Provisioned Service resource **MUST** define a `.status.binding` which is a `LocalObjectReference`-able (containing a single field `name`) to a `Secret`. The `Secret` **MUST** be in the same namespace as the resource. The `Secret` data **SHOULD** contain a `type` entry with a value that identifies the abstract classification of the binding. The `Secret` type (`.type` verses `.data.type`) **SHOULD** reflect this value as `service.binding/{type}`, replacing `{type}` with the `Secret` data type. It is **RECOMMENDED** that the `Secret` data also contain a `provider` entry with a value that identifies the provider of the binding. The `Secret` data **MAY** contain any other entry. To facilitate discoverability, it is **RECOMMENDED** that a `CustomResourceDefinition` exposing a Provisioned Service add `service.binding/provisioned-service: "true"` as a label. | |||
|
|||
> Note: While the Provisioned Service referenced `Secret` data should contain a `type` entry, the `type` must be defined before it is projected into an application workload. This allows a mapping to enrich an existing secret. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.spec.type
is removed by this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that now :-)
The removal of .spec.type
and .spec.provider
should be called out in the PR description because I don't see mentioning it in #145.
BTW, I am fine with removing .spec.type
and .spec.provider
. That way, the reconciler can mount the Secret resource into the application workload, and no need to create an intermediate Secret resource.
I hope soon the extensions mentioned in #145 will become a reality!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of .spec.type and .spec.provider should be called out in the PR description
updated the PR subject and overview
I hope soon the extensions mentioned in #145 will become a reality!
nothing to wait for. Start creating and using them today; they're just not part of the spec, yet(?)
Based on the call today, we want to reevaluate removing the |
I tried the following configuration but seems to be not working. This is the error message in the pod:
|
I just read the docs:
|
I tried to use life cycle hooks after setting
This is the error message:
|
@baijum thanks for the research |
@scothis A projected volume maps several existing volume sources into the same directory. Here is a modified example:
As you can see the original value for
I tried to change some values in the Secret resource, and that is getting reflected in the file system immediately. So, we are good to go with merging this PR :-) Edit: typo |
Based on the above information, we can retain
(Feel free to rephrase) |
The Application Projection section 2nd paragraph also needs some re-write. This is how it currently reads:
|
While bring back these fields and the general capability, I removed references that mandated these fields be added to a Secret. Instead, the requirement is that they are part of the application projection. Implementors can figure out the best way to make that happen, either by creating a derivative Secret, or by using a projected volume. Signed-off-by: Scott Andrews <[email protected]>
@baijum updated to restore the type and provider fields on the ServiceBindingSpec. Removed references to "secrets" in the application projection as a Secret is more of an implementation detail at this point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I implemented the |
@scothis Please update the title of this PR: type and provider is not removed. |
@@ -115,6 +114,8 @@ An implementation is not compliant if it fails to satisfy one or more of the MUS | |||
|
|||
A Provisioned Service resource **MUST** define a `.status.binding` which is a `LocalObjectReference`-able (containing a single field `name`) to a `Secret`. The `Secret` **MUST** be in the same namespace as the resource. The `Secret` data **SHOULD** contain a `type` entry with a value that identifies the abstract classification of the binding. The `Secret` type (`.type` verses `.data.type`) **SHOULD** reflect this value as `service.binding/{type}`, replacing `{type}` with the `Secret` data type. It is **RECOMMENDED** that the `Secret` data also contain a `provider` entry with a value that identifies the provider of the binding. The `Secret` data **MAY** contain any other entry. To facilitate discoverability, it is **RECOMMENDED** that a `CustomResourceDefinition` exposing a Provisioned Service add `service.binding/provisioned-service: "true"` as a label. | |||
|
|||
> Note: While the Provisioned Service referenced `Secret` data should contain a `type` entry, the `type` must be defined before it is projected into an application workload. This allows a mapping to enrich an existing secret. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed some key words (should / must) weren't in the proper format, and I think the wording was a bit confusing in terms of what the spec is saying must be present (which is the type
in the projection, not the secret)
> Note: While the Provisioned Service referenced `Secret` data should contain a `type` entry, the `type` must be defined before it is projected into an application workload. This allows a mapping to enrich an existing secret. | |
> Note: While the Provisioned Service referenced `Secret` data **SHOULD** contain a `type` entry, the `type` **MUST** be present in the application projection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a non-normative block, so it intentionally uses unstylized "should" and "must". The spec requirements are captured in the Application Projection section.
The driver for this note is #155
The functionality enabled by mappings can/will be replaced with dedicated resources that can decorate a secret exposing the ProvisionedService duck-type which can be consumed by a ServiceBinding. Custom type and provider fields are now managed with projected volumes and field path env vars. Refs servicebinding/spec#154 Signed-off-by: Scott Andrews <[email protected]>
The functionality enabled by mappings can/will be replaced with dedicated resources that can decorate a secret exposing the ProvisionedService duck-type which can be consumed by a ServiceBinding. Custom type and provider fields are now managed with projected volumes and field path env vars. Refs servicebinding/spec#154 Signed-off-by: Scott Andrews <[email protected]>
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:
Secrets
templating, but were limited in their capabilities
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.
The
.spec.type
and.spec.provider
fields are also removed, asthey are syntactic sugar on top of mappings.
Refs #145
Resolves #155
Signed-off-by: Scott Andrews [email protected]