Deploy the instance

Provision custom config maps and secrets on Red Hat OpenShift Container Platform (RHOCP) to configure Red Hat Developer Hub before running the application.

Before you begin

  • By using the OpenShift CLI (oc), you have access, with developer permissions, to the OpenShift cluster aimed at containing your Developer Hub instance.

About this task

Tip

On Red Hat OpenShift Container Platform, you can skip this step to run Developer Hub with the default config map and secret. Your changes on this configuration might get reverted on Developer Hub restart.

Procedure

  1. For security, store your secrets as environment variables values in an OpenShift Container Platform secret, rather than in plain text in your configuration files. Collect all your secrets in the secrets.txt file, with one secret per line in KEY=value form.
  2. Author your custom app-config.yaml file. This is the main Developer Hub configuration file. You need a custom app-config.yaml file to avoid the Developer Hub installer to revert user edits during upgrades. When your custom app-config.yaml file is empty, Developer Hub is using default values.
    • To prepare a deployment with the Red Hat Developer Hub Operator on OpenShift Container Platform, you can start with an empty file.
    • To prepare a deployment with the Red Hat Developer Hub Helm chart, or on Kubernetes, enter the Developer Hub base URL in the relevant fields in your app-config.yaml file to ensure proper functionality of Developer Hub. The base URL is what a Developer Hub user sees in their browser when accessing Developer Hub. The relevant fields are baseUrl in the app and backend sections, and origin in the backend.cors subsection:

      Configuring the baseUrl in app-config.yaml:

      app:
        title: Red Hat Developer Hub
        baseUrl: https://<my_developer_hub_domain>
      
      backend:
        auth:
          externalAccess:
            - type: legacy
              options:
                subject: legacy-default-config
                secret: "${BACKEND_SECRET}"
        baseUrl: https://<my_developer_hub_domain>
        cors:
          origin: https://<my_developer_hub_domain>
    • Optionally, enter your configuration such as:
  3. Author your custom dynamic-plugins.yaml file to enable plugins. By default, Developer Hub enables a minimal plugin set, and disables plugins that require configuration or secrets, such as the GitHub repository discovery plugin and the Role-based access control (RBAC) plugin.

    Enable the GitHub repository discovery and the RBAC features:

    dynamic-plugins.yaml

    includes:
      - dynamic-plugins.default.yaml
    plugins:
      - package: ref://backstage-plugin-catalog-backend-module-github
        enabled: true
      - package: ref://backstage-community-plugin-rbac
        enabled: true
  4. Provision your custom configuration files to your OpenShift Container Platform cluster.
    1. Create the <my-rhdh-project> project aimed at containing your Developer Hub instance.
      $ oc create namespace my-rhdh-project
    2. Create config maps for your app-config.yaml and dynamic-plugins.yaml files in the <my-rhdh-project> project.
      $ oc create configmap my-rhdh-app-config \
        --from-file=app-config.yaml \
        --namespace=my-rhdh-project
      $ oc create configmap dynamic-plugins-rhdh \
        --from-file=dynamic-plugins.yaml \
        --namespace=my-rhdh-project

      You can also create the config maps by using the web console.

    3. Provision your secrets.txt file to the my-rhdh-secrets secret in the <my-rhdh-project> project.
      $ oc create secret generic my-rhdh-secrets \
        --from-file=secrets.txt \
        --namespace=my-rhdh-project

      You can also create the secret by using the web console.

What to do next