Skip to content
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

Adoption of annotations from specification #403

Closed
arthurdm opened this issue Mar 27, 2020 · 10 comments
Closed

Adoption of annotations from specification #403

arthurdm opened this issue Mar 27, 2020 · 10 comments
Assignees
Labels
kind/enhancement New feature or request v0.3.0

Comments

@arthurdm
Copy link
Member

arthurdm commented Mar 27, 2020

The section of the service binding specification that describes the x-descriptors and annotations that a service should use to be bindable uses slightly different names than what SBO supports today.

A proposal is:

  • start supporting the annotations from the spec
  • document that SBO is deprecating the usage of its old annotations described here, but continue to use it for a release or two to give time for migration of any existing services.

This is an important item to get adoption of the spec, since we're starting to reach out to services (Strimzi, Postgresql, etc) to make them more bindable.

@sbose78
Copy link
Member

sbose78 commented Mar 28, 2020

Thanks, let me follow-up with a "before" and "after" of the annotations.

@sbose78 sbose78 added the kind/enhancement New feature or request label Mar 30, 2020
@sbose78
Copy link
Member

sbose78 commented Mar 30, 2020

@Avni-Sharma Could you please review the spec and provide an example of how the new annotations would look like for https://github.com/operator-backing-service-samples/postgresql-operator ?

2. Non-OLM Operator: - An annotation in the Operator's CRD to mark which `status` properties reference the [binding data](#service-binding-schema).  The value of this annotation can be specified in either [JSONPath](https://kubernetes.io/docs/reference/kubectl/jsonpath/) or [GO templates](https://golang.org/pkg/text/template/):
      * ConfigMap:
        * servicebinding/configMap: {.status.bindable.ConfigMap}
      * Secret:
        * servicebinding/secret: {.status.bindable.Secret}
      * Individual binding items:
        * servicebinding/secret/host: {.status.address}
        * servicebinding/secret/`<binding_property>`: {.status.`<status_property>}` (where `<binding_property>` is any property from the binding schema, and `<status_property>` refers to the path to the correspoding `status` property)

@Avni-Sharma
Copy link
Contributor

Currently, the annotations are like

    servicebindingoperator.redhat.io/spec.dbName: 'binding:env:attribute'
    servicebindingoperator.redhat.io/status.dbCredentials-user: 'binding:env:object:secret'
    servicebindingoperator.redhat.io/status.dbCredentials-password: 'binding:env:object:secret'
    servicebindingoperator.redhat.io/status.dbConnectionIP: 'binding:env:attribute'
    servicebindingoperator.redhat.io/status.dbConnectionPort: 'binding:env:attribute'
    servicebindingoperator.redhat.io/status.dbName: 'binding:env:attribute'
    servicebindingoperator.redhat.io/status.dbConfigMap-db.host: 'binding:env:object:configmap'
    servicebindingoperator.redhat.io/status.dbConfigMap-db.port: 'binding:env:object:configmap'
    servicebindingoperator.redhat.io/status.dbConfigMap-db.name: 'binding:env:object:configmap'
    servicebindingoperator.redhat.io/status.dbConfigMap-db.user: 'binding:env:object:configmap'
    servicebindingoperator.redhat.io/status.dbConfigMap-db.password: 'binding:env:object:configmap'

In the current scenario we have the env option when we need to inject the bindable data as an environment variable. That can also be changed to volumemount incase we need to have data as a volumemount. In the spec [https://github.com/application-stacks/service-binding-specification/tree/updateSchema#pointer-to-binding-data] we have not used it. Are we planning to drop the env/volumemount option altogether?

@arthurdm
Copy link
Member Author

hi @Avni-Sharma - I have opened this issue in the spec side to also support environment variables. I was convinced that in cases of non-sensitive data it's still a very practical and used method. =)

@Avni-Sharma
Copy link
Contributor

Reference - servicebinding/spec#25

@otaviof
Copy link
Member

otaviof commented Apr 23, 2020

Community meeting notes:

@arthurdm
Copy link
Member Author

@isutton / @sbose78 - we could use this issue to lay out the plan and divide-and-conquer in terms of resources?

@isutton
Copy link
Contributor

isutton commented May 18, 2020

@Avni-Sharma will be implementing this with my collaboration.

The plan so far is, with the changes introduced in #407 :

  • Modify annotations.BuildHandler to support the new annotations;
  • Implement a predicate similar to IsConfigMap to build the right annotation handler; and
  • Implement a type consuming annotations.Handler, which will be returned by annotations.BuildHandler. The implementation will provide the Handle method which is responsible to create a annotation.Result value (this is the type that should be adapted to provide the new annotation semantics.

I currently don't believe it is necessary to have more hands on the deck for this.

What do y'all think?

@isutton
Copy link
Contributor

isutton commented May 18, 2020

/assign @Avni-Sharma

@Avni-Sharma
Copy link
Contributor

Support added in #628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request v0.3.0
Projects
None yet
Development

No branches or pull requests

5 participants