parodos-dev / orchestrator-helm-chart

Helm chart to deploy the Orchestrator solution suite.
https://parodos.dev/orchestrator-helm-chart/
Apache License 2.0
2 stars 22 forks source link

"create-ocp-project" workflow not detecting already configured "service" for RHDH at "rhdh-operator" namespace #271

Open epnaveen opened 3 days ago

epnaveen commented 3 days ago

Scenario:

  1. RHDH already installed on OpenShift (4.15.30_1558_openshift) - This is ROKS on IBM Cloud

  2. Installed Orchestrator by following instructions here (skipped a few steps to adjust to existing install of RHDH)

  3. Verified Orchestrator functions by testing the greetings workflow

  4. Installed create-ocp-project workflow by following instructions located here

    image
  5. A test run of the workflow failed with Unable to invoke request: java.net.UnknownHostException: backstage-backstage.rhdh-operator: Name or service not known error

Expectation: This error should not have occurred

Reasoning:

  1. I didn’t enter a service name called backstage-backstage anywhere during the set up of any of the aforementioned
  2. As mentioned earlier, the system already had RHDH running and it was deployed using operator
  3. The deployment of create-ocp-project workflow should have detected the existing service backstage-developer-hub automatically

Note: I worked around the issue by creating a new service called backstage-backsatage. Didn’t touch the stock service (backstage-developer-hub) as am afraid that it may break something else. create-ocp-project-5595448f95-7cw2t-workflow.log

masayag commented 1 day ago

Hi @epnaveen and thanks for reporting this issue. The workflow is installed with defaults value that match the RHDH installed instance by the orchestrator. For running against an existing RHDH instance, there is a need to update the configmap that points to the existing RHDH service (no need to create a dedicated service for it). See https://github.com/parodos-dev/serverless-workflows-config/blob/main/charts/create-ocp-project/templates/01-configmap_create-ocp-project-props.yaml#L5

apiVersion: v1
data:
  application.properties: |
    # Backstage Notifications service
    quarkus.rest-client.notifications.url=${BACKSTAGE_NOTIFICATIONS_URL:http://backstage-backstage.rhdh-operator}
    quarkus.openapi-generator.notifications.auth.BearerToken.bearer-token=${NOTIFICATIONS_BEARER_TOKEN:-}
...

BACKSTAGE_NOTIFICATIONS_URL is a variable to points to the existing RHDH instance. There are several options to set this variable:

  1. Edit the configmap directly and replace the default value http://backstage-backstage.rhdh-operator with yours
  2. Edit the create-ocp-project Sonataflow CR in sonataflow-infra and set the env var under
       podTemplate:
          container:
             env:
               - name: NOTIFICATIONS_BEARER_TOKEN
               - value: http://<existing rhdh service>
  3. By adding the variable to the create-ocp-project-creds secret (this resources is a good fit for credentials, but can be used for any env-var)

Any of the option will make the env variable available for the existing workflow Quarkus service that serves the workflow. Pls note that same will have to be applied for other required env-vars as defined in https://github.com/parodos-dev/serverless-workflows-config/blob/main/charts/create-ocp-project/templates/01-configmap_create-ocp-project-props.yaml.

There is a place for improvement in the docs for this section and I'll make sure it is better explained.

masayag commented 1 day ago

There is a section that refers to that part: https://github.com/parodos-dev/serverless-workflows-config/blob/main/charts/create-ocp-project/INSTALL.md#environment-variables