-
Bug
-
Resolution: Unresolved
-
Undefined
-
1.8.2
-
None
-
False
-
-
False
-
-
Description of problem:
As part of the resolution of the issue RHDHBUGS-2623 was detected a gap in the current documentation to manage external databases for the SonataFlowPlatform. The default configuration requires the usage of specific patterns to connect to the database, which are related with the default values used by the Operator to deploy the database. When you are using an external database with Red Hat Developer Hub, those resources might be not available and there are other resources to identify the database used. Here is the gap.
Adding a section in the documentation could help others to follow the right steps to deploy and integrate Red Hat Developer Hub and the Orchestrator using an external database not managed by the Operator.
Basically the steps to deploy this configuration is:
- Having an external database to use with Red Hat Developer Hub. It must be a service available to connect to it.
- Having a secret with the credentials to access to database: `POSTGRES_HOST`, `POSTGRES_PORT`, `POSTGRES_USER`, `POSTGRES_PASSWORD`
- Deploy the SonataFlowPlatform CR using the resources for the external database.
apiVersion: batch/v1 kind: Job metadata: name: create-sonataflow-database-developer-hub spec: ttlSecondsAfterFinished: 30 activeDeadlineSeconds: 120 template: spec: containers: - name: psql image: quay.io/fedora/postgresql-15:latest resources: limits: cpu: "100m" memory: "128Mi" requests: cpu: "100m" memory: "64Mi" securityContext: readOnlyRootFilesystem: true allowPrivilegeEscalation: false runAsNonRoot: true capabilities: drop: - ALL envFrom: - secretRef: name: <SECRET-NAME-WITH-DB-CREDENTIALS> command: [ "sh", "-c" ] args: - | set -e DB_EXISTS=$(PGPASSWORD=${POSTGRES_PASSWORD} psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USER} -tAc "SELECT 1 FROM pg_database WHERE datname='backstage_plugin_orchestrator'" postgres) if [ -z "$DB_EXISTS" ]; then PGPASSWORD=${POSTGRES_PASSWORD} psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USER} -c "CREATE DATABASE backstage_plugin_orchestrator;" postgres fi restartPolicy: Never --- apiVersion: sonataflow.org/v1alpha08 kind: SonataFlowPlatform metadata: name: sonataflow-platform spec: monitoring: enabled: true services: dataIndex: enabled: true persistence: postgresql: secretRef: name: <SECRET-NAME-WITH-DB-CREDENTIALS> userKey: POSTGRES_USER passwordKey: POSTGRES_PASSWORD serviceRef: name: <SERVICE-NAME-TO-DB> namespace: <RHDH-NAMESPACE> databaseName: backstage_plugin_orchestrator jobService: enabled: true persistence: postgresql: secretRef: name: <SECRET-NAME-WITH-DB-CREDENTIALS> userKey: POSTGRES_USER passwordKey: POSTGRES_PASSWORD serviceRef: name: <SERVICE-NAME-TO-DB> namespace: <RHDH-NAMESPACE> databaseName: backstage_plugin_orchestrator
- Declare the Orchestrator Plugins in the dynamic-plugins config to remove the dependency with the `sonataflow` object and declare the service name of the SonataFlowPlatform services created in the previous step:
# Orchestrator - package: "@redhat/backstage-plugin-orchestrator@1.8.2" disabled: false - package: "@redhat/backstage-plugin-orchestrator-backend-dynamic@1.8.2" disabled: false pluginConfig: orchestrator: dataIndexService: url: http://<SERVICE-NAME-SONATAFLOW-PLATFORM-DATA-INDEX> dependencies: [{}] - package: "@redhat/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic@1.8.2" disabled: false pluginConfig: orchestrator: dataIndexService: url: http://<SERVICE-NAME-SONATAFLOW-PLATFORM-DATA-INDEX> dependencies: [{}] - package: "@redhat/backstage-plugin-orchestrator-form-widgets@1.8.2" disabled: false
- Update your Red Hat Developer Hub instance to use the new dynamic plugins configuration and inject the database credentials secrets.
This documentation could be added as extension of one of the following current documentation resources:
- https://github.com/redhat-developer/rhdh-operator/blob/main/docs/orchestrator.md#optional-enabling-workflow-in-a-different-namespace
- https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.8/html/orchestrator_in_red_hat_developer_hub/assembly-orchestrator-rhdh#con-orchestrator-plugin-dependencies-operator_orchestrator-rhdh
Prerequisites (if any, like setup, operators/versions):
Steps to Reproduce
Just follow the introduction of this issue.
Actual results:
Expected results:
Reproducibility (Always/Intermittent/Only Once):
Build Details:
Additional info (Such as Logs, Screenshots, etc):
- is caused by
-
RHDHBUGS-2623 Unable to declare different database configuration for Orchestrator Plugins by the Operator
-
- Review
-