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

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

Open
epnaveen opened this issue Sep 20, 2024 · 2 comments

Comments

@epnaveen
Copy link

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
  1. 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
Copy link
Contributor

masayag commented Sep 22, 2024

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
Copy link
Contributor

masayag commented Sep 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants