Uploaded image for project: 'Service Binding'
  1. Service Binding
  2. APPSVC-526

Parse simple binding annotations

XMLWordPrintable

    • App Services Sprint 184, Sprint 185, Sprint 190

      Goal

      Support a re-defined annotations' format for operator/service authors to define what is "interesting" for applications to bind.

      A CRD or a CR or a resource having binding annotations directly referring to "elementType=string" should be bindable end-to-end. Note, when the "elementType" is not specified in an annotation, it must default to "string".

      Sample scenarios

      • Use a specific key in configmap or secret as volume mount
        “servicebinding.dev/host”: "path={.status.data.dbConfiguration},objectType=ConfigMap,bindAs=volume,elementType=string,sourceKey=myhost
      • Use a specific key in configmap or secret as volume mount without explicit specification of elementType=string. elementType should default to string, hence
        “servicebinding.dev/host”: "path={.status.data.dbConfiguration},objectType=ConfigMap,bindAs=volume,sourceKey=myhost
      • Use an entire configmap or secret as environment variables
        “servicebinding.dev/doesntmatter”: "path={.status.data.dbConfiguration},objectType=ConfigMap,bindAs=envVar

      Note, bindAs should default to "envVar" & `elementType` should default to `string`. It may or may not be specified in the annotation, example

      “servicebinding.dev/host”: "path={.status.data.dbConfiguration},objectType=ConfigMap,sourceKey=myhost

      Acceptance Criteria

      1. A CRD or a CR/resource having binding annotations directly referring to "elementType=string" should be bindable end-to-end.
      2. Guidance in the annotations associated with use of envVar or volume mount should be taken into account.
      3. Guidance in the annotations associated with use of specific "source" keys in the configmap/secret should be taken into account.
      4. Use suggested destination binding secret key “servicebinding.dev/host” while building the binding secret.
      5. Global or service-specific environment variable prefix needs to be taken into account.
      6. Global or service-specific volume mount prefix needs to be taken into account.

      Notes:

      What is simple binding metadata ?

      If the binding metadata being referred to is a string, then it's called "simple".

          apiVersion: apps.kube.io/v1beta1
          kind: Database
          metadata:
          name: my-cluster
          spec:
          ...
          status:
              data:
                  url: db.stage.ibm.com
                  credentials: my-creds-secret
      

      Here, the value of "status.data.url" & ""status.data.my-creds-secret" is a string, and thereby being referred to as "simple" metadata

      What is complex binding metadata ?

      If the binding metadata being referred to is a slice or slice of maps, then it's called "complex".
      Associated epic: https://issues.redhat.com/browse/APPSVC-528

              isuttonl Igor Sutton (Inactive)
              shbose Shoubhik Bose
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: