This documentation is for a release that is no longer maintained
See documentation for the latest supported version.Chapter 3. Supported configurations for Red Hat Developer Hub
This section describes the configurations that are required to access the Red Hat Developer Hub, including:
- Custom applications configuration
- Source control configuration for Developer Hub Catalog
3.1. Adding a custom application configuration file to Red Hat OpenShift Container Platform Copy linkLink copied to clipboard!
To access the Red Hat Developer Hub, you must add a custom application configuration file to OpenShift. In OpenShift Container Platform, you can use the following content as a base template to create a ConfigMap named app-config-rhdh:
Prerequisites
- You have created an Red Hat OpenShift Container Platform account.
Procedure
- From the OpenShift Container Platform web console, select the ConfigMaps tab.
- Click Create ConfigMap.
- From Create ConfigMap page, select the YAML view option in Configure via and make the changes to the file, if needed.
- Click Create.
Go to the Helm tab.
The list of Helm Releases appears on the page.
- Click the overflow menu on a Helm release and select Upgrade.
Use one of the following views to edit the Helm configuration:
Using Form view
-
Expand Root Schema
Backstage chart schema Backstage parameters Extra app configuration files to inline into command arguments. - Click the Add Extra app configuration files to inline into command arguments link.
Enter the value in the following fields:
-
configMapRef:
app-config-rhdh -
filename:
app-config-rhdh.yaml
-
configMapRef:
- Click Upgrade.
-
Expand Root Schema
Using YAML view
Set the value of the
upstream.backstage.extraAppConfig.configMapRefandupstream.backstage.extraAppConfig.filenameparameters in the following manner:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Upgrade.
3.2. Adding source control for Catalog in Red Hat Developer Hub Copy linkLink copied to clipboard!
To populate the Catalog in Red Hat Developer Hub, you need to add software templates, and to add the templates, you must enable a source control such as GitHub, GitLab, or BitBucket.
Prerequisites
- You have a GitHub account.
- You have an account on the Red Hat OpenShift cluster.
- You have installed the Developer Hub, otherwise the GitHub login fails. For more information about installation, see Chapter 2, Installing Red Hat Developer Hub.
3.2.1. Configuring GitHub authentication Copy linkLink copied to clipboard!
The configuration of GitHub authentication is required to enable the GitHub OAuth login in Developer Hub.
Procedure
- In the Red Hat OpenShift cluster, navigate to the main page of the GitHub organization where you want to create the OAuth application.
-
Click Settings
Developer Settings OAuth Apps Register an application -
Enter the application name as
Developer Hub. Add the following URL as the Homepage URL:
https://developer-hub-<NAMESPACE_NAME>.<OPENSHIFT_ROUTE_HOST>/Add the following URL as Authorization callback URL:
https://developer-hub-<NAMESPACE_NAME>.<OPENSHIFT_ROUTE_HOST>/api/auth/github/handler/frame- Clear the Enable Device Flow checkbox.
- Click Register application to create your OAuth application.
- After creating the application, click Generate a new client secret and copy the generated client secret.
- In OpenShift, click ConfigMaps.
Generate a key/value secret named 'github-secrets' using the provided environment variables as keys, and input the values you generated for your GitHub OAuth application:
- In Red Hat OpenShift, go to the Secrets tab and click Create.
- Select Key/value secret.
-
Enter Secret name as
github-secrets. Add environment variables as Key and Value and click Create.
Expand Table 3.1. Environment variables Key Value GITHUB_OAUTH_CLIENT_IDClient ID from OAuth application
GITHUB_OAUTH_CLIENT_SECRETClient Secret from OAuth application
Modify your
app-config-rhdhConfigMap to include the GitHub authentication configuration as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Save.
- Navigate to the Helm tab and select Upgrade.
Use one of the following views to edit the Helm configuration:
Using Form view
-
Expand Root Schema
Backstage Chart Schema Backstage Parameters Backstage container environment variables from existing Secrets. - Click the Add Backstage container environment variables from existing Secrets link.
-
Enter
github-secretsas the value. - Click Upgrade.
-
Expand Root Schema
Using YAML view
Set the value of the
upstream.backstage.extraEnvVarsSecretsparameter togithub-secretsas shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Upgrade.
3.2.2. Configuring GitHub integration Copy linkLink copied to clipboard!
The configuration of GitHub is required to enable the GitHub plugins in Developer Hub.
Procedure
- In the Red Hat OpenShift cluster, navigate to the main page of the GitHub organization where you want to create the OAuth application.
-
Click Settings
Developer Settings GitHub Apps New GitHub App. -
Enter the application name as
Developer Hub. Add the following URL as the Homepage URL:
https://developer-hub-<NAMESPACE_NAME>.<OPENSHIFT_ROUTE_HOST>/Add the following URL as Authorization callback URL:
https://developer-hub-<NAMESPACE_NAME>.<OPENSHIFT_ROUTE_HOST>/api/auth/github/handler/frame-
Deselect Webhook URL
Active. - Under the Where can this GitHub App be installed? section, ensure that Only on this account is selected.
- Click Register application.
- After creating the application, click Generate a new client secret and copy the generated client secret.
- Click Generate a private key at the bottom of the page and download the generated file.
- In OpenShift, click ConfigMaps.
Generate a key/value secret named 'github-secrets' using the provided environment variables as keys, and input the values you generated for your GitHub OAuth application:
- In Red Hat OpenShift, go to the Secrets tab and click Create.
- Select Key/value secret.
-
Enter Secret name as
github-secrets. - Add environment variables as Key and Value and click Create.
Expand Table 3.2. Environment variables Key Value GITHUB_APP_APP_ID
App ID from GitHub application
GITHUB_APP_CLIENT_ID
Client ID from GitHub application
GITHUB_APP_CLIENT_SECRET
Client Secret from GitHub application
GITHUB_APP_WEBHOOK_URL
Enter "none"
GITHUB_APP_WEBHOOK_SECRET
Enter "none"
GITHUB_APP_PRIVATE_KEY
Upload the private key that was downloaded
Modify your
app-config-rhdhConfigMap to include the GitHub integration configuration as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Click Toplogy
developer hub Actions (drop-down) Restart rollout.
3.2.3. Enabling GitHub discovery in Red Hat Developer Hub Copy linkLink copied to clipboard!
You can enable GitHub discoverability for your components in Developer Hub, such as any repositories that contain catalog-info.yaml file.
Prerequisites
- You have set up the GitHub integration. For more information, see Section 3.2.2, “Configuring GitHub integration”.
Procedure
- In the Developer perspective of the OpenShift Container Platform web console, go to the Helm tab.
- Click the overflow menu on a Helm release and select Upgrade.
Use one of the following views to edit the Helm configuration:
Using Form view
-
Expand Root Schema
global Dynamic plugins configuration List of dynamic plugins that should be installed in the backstage application. - Click the Add List of dynamic plugins that should be installed in the backstage application link.
In the Package specification of the dynamic plugin to install. It should be usable by the
npm packcommand. field, add the following value:./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic- Click Upgrade.
-
Expand Root Schema
Using YAML view
Set the value of the
global.dynamic.plugins.packageparameter to./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamicas shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Upgrade.
Add the following code in the ConfigMap:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the previous code, replace
${GITHUB_ORG}with the GitHub organization from where you want to discover the components. Also, if there is a single provider, then following code can be added in the ConfigMap:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
providerIdin the previous code is required to identify the provider when there is a list of them.- Click Save.
3.2.4. Enabling GitHub organization member discovery in Red Hat Developer Hub Copy linkLink copied to clipboard!
You can also enable GitHub discoverability for the members of your GitHub organization.
Prerequisites
- You have set up the GitHub integration. For more information, see Section 3.2.2, “Configuring GitHub integration”.
Procedure
- In the Developer perspective of the OpenShift Container Platform web console, go to the Helm tab.
- Click the overflow menu on a Helm release and select Upgrade.
Use one of the following views to edit the Helm configuration:
Using Form view
-
Expand Root Schema
global Dynamic plugins configuration List of dynamic plugins that should be installed in the backstage application. - Click the Add List of dynamic plugins that should be installed in the backstage application link.
In the Package specification of the dynamic plugin to install. It should be usable by the
npm packcommand. field, add the following value:./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-org-dynamic- Click Upgrade.
-
Expand Root Schema
Using YAML view
Set the value of the
global.dynamic.plugins.packageparameter to./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-org-dynamicas shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Upgrade.
Add the following code in the ConfigMap:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow where:
${GITHUB_URL}- Denotes a variable that you must replace with the GitHub URL.
${GITHUB_ORG}- Denotes a variable that you must replace with the GitHub organization you want to ingest users from.
- Click Save.