Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Custom environment variables for service binding #229

Description

@matthewpwilson

Feature Request

Is your feature request related to a problem?

I want to use service binding to consume a RESTful service exposed by another microservice that's part of my application. The consuming service is written using MicroProfile REST client, which has a specific naming convention for environment variables. So I want to map the attributes of the service I consume to an environment variable with a specific name. Today I can work around it like this:

apiVersion: appsody.dev/v1beta1
kind: AppsodyApplication
metadata:
  name: coffeeshop-ui
spec:
  service:
    consumes:
      - category: openapi
        name: barista-http
        namespace: default 
  env: 
    - name: EXAMPLE_BARISTASERVICE_MP_REST_URL
      valueFrom:
        secretKeyRef:
          key: url
          name: coffeeshop-barista-http

i.e. by manually referencing the secret created by the operator. However, this is relying on the details of the how the secret is created, and requires extra configuration.
It's likely that other frameworks could have similar requirements for naming of environment variables.

Describe the solution you'd like

It would be much more convenient if I could map the environment variable as part of consuming the service, perhaps something like this:

consumes:
      - category: openapi
        name: barista-http
        namespace: default 
        customEnvVar:
          name: EXAMPLE_BARISTASERVICE_MP_REST_URL
          valueFrom: url

This is somewhat similar to customEnvVar feature in the ServiceBindingRequest CRD.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions