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

Service Bindings: Project data as Environment Variable

XMLWordPrintable

    • AppSvc Sprint 240

      Owner: Architect:

      Francesco Ilario

      Story (Required)

      As a Application Developer,
      I would like Primaza to project data to environment variables
      so that I can read configuration from environment variables (coherently to 12-factors principles)

      Background (Required)

      As of now we are projecting Service's data only in file system.
      We should allow the user to ask for that to be projected as Environment Variables too.

      See epic for arch document link.

      Glossary

      See glossary in architecture document

      Out of scope

      • Override name for environment variables

      In Scope

      • define in Service Claim the projection strategy
      • project data as environment variables

      Approach(Required)

      Add a property to Service Claims and Service Bindings named env.
      As in ServiceBinding spec (new), it will contain a list of objects with a name and a key.
      name is the Environment Variable name in the pod, key is the name of the key from the Secret.

      spec: 
        ...
        env: 
        - name: MY_ENV_VARIABLE
          key: secret's-key
        ...
      

      If the env property exists in the Service Claim, it should be copied over to ServiceBindings from the ServiceClaim controller.

      If the env property exists in the Service Binding, its content should be used for projecting Secret data as environment variable.

      Demo requirements(Required)

      NA

      Dependencies

      NA

      Edge Case

      NA

      BDD Tests

      You can find BDD Test specification for this story in the "Testing Instruction" Field Tab or in the GitHub Issue linked to this story.
      Click here for all BDD Tests Issues.

      Acceptance Criteria

      • Development
        ServiceClaim controller uses env property when generating the ServiceBinding
        ServiceBinding controller (Application Agent) uses env property to project Secret data as Environment Variable (as Service Binding spec does)
        ServiceBinding controller (Application Agent) uses env remove Environment Variable when unbinding the service (as Service Binding spec does)
      • QE
        There are test cases for data projected as Environment Variables
      • Docs
        There is a section in our docs dedicated to explaining projection as Environment Variables
        Update architecture document with any changes while implementing

      INVEST Checklist

      Dependencies identified
      Blockers noted and expected delivery timelines set
      Design is implementable
      Acceptance criteria agreed upon
      Story estimated

      Legend

      Unknown
      Verified
      Unsatisfied

              kmamgain@redhat.com Kartikey Mamgain (Inactive)
              rh-ee-filario Francesco Ilario
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: