Install with a Helm chart

The following procedures describe how to install Ansible plug-ins in Red Hat Developer Hub instances on Red Hat OpenShift Container Platform using a Helm chart.

The workflow is as follows:

  1. Download the Ansible plug-ins files.
  2. Create a plug-in registry in your OpenShift cluster to host the Ansible plug-ins.
  3. Add the plug-ins to the Helm chart.
  4. Create a custom ConfigMap.
  5. Add your custom ConfigMap to your Helm chart.
  6. Edit your custom ConfigMap and Helm chart according to the required and optional configuration procedures. Note

    You can save changes to your Helm and ConfigMap after each update to your configuration. You do not have to make all the changes to these files in a single session.

Prerequisites

To proceed, you must have Red Hat Developer Hub installed on Red Hat OpenShift Container Platform (OCP) and a valid subscription to Red Hat Ansible Automation Platform.

  • Red Hat Developer Hub installed on Red Hat OpenShift Container Platform.
    • For Helm installation, follow the steps in the Installing Red Hat Developer Hub on OpenShift Container Platform with the Helm chart section of Installing Red Hat Developer Hub on OpenShift Container Platform.
    • For Operator installation, follow the steps in the Installing Red Hat Developer Hub on OpenShift Container Platform with the Operator section of Installing Red Hat Developer Hub on OpenShift Container Platform.
  • A valid subscription to Red Hat Ansible Automation Platform.
  • An OpenShift Container Platform instance with the appropriate permissions within your project to create an application.
  • The Red Hat Developer Hub instance can query the automation controller API.
  • Optional: To use the integrated learning paths, you must have outbound access to developers.redhat.com.

Choose a plug-in delivery method

Ansible plug-ins for Red Hat Developer Hub support two delivery methods. Choose the method that fits your environment.

  • OCI container (recommended): Red Hat Developer Hub pulls the Ansible plug-ins directly from registry.redhat.io as OCI artifacts during startup. You do not need to use any manual file downloads or plug-in registry deployment.
  • HTTP plug-in registry: Manually download the Ansible plug-ins tarball files, deploy an HTTP plug-in registry in your OpenShift cluster, and configure Red Hat Developer Hub to pull plug-ins from that registry. Use this method if your environment cannot pull OCI artifacts from registry.redhat.io.

Complete one of the following procedures before configuring the Ansible plug-ins in the Required configuration section.

Use OCI container delivery method

Red Hat Developer Hub pulls the Ansible plug-ins directly from registry.redhat.io as OCI artifacts. This is the recommended method that requires a registry authentication secret in the same OpenShift project as your Red Hat Developer Hub deployment.

Before you begin

  • You have a Red Hat account with access to registry.redhat.io.
  • You have a registry service account token from the Red Hat Customer Portal.
  • You have access to the OpenShift project. In the same project you had installed Red Hat Developer Hub.
  • You have installed the OpenShift CLI (oc) and logged in to your cluster.

About this task

This method is the default for the Helm chart and is the recommended method for production deployments.

Procedure

  1. Create an auth.json file on your local machine with your registry.redhat.io credentials:
    {
      "auths": {
        "registry.redhat.io": {
          "auth": "<base64-encoded-username:password>"
        }
      }
    }

    To generate the base64-encoded value use the printf '%s' '<username>:<password>' | base64 command.

  2. Create the authentication secret in the OpenShift project where you installed Red Hat Developer Hub.

    The secret name must follow the pattern <deployment-name>-dynamic-plugins-registry-auth, where <deployment-name> matches your Red Hat Developer Hub deployment name.

    • For a default Red Hat Developer Hub Helm installation with release name developer-hub:

      oc create secret generic developer-hub-dynamic-plugins-registry-auth \
        --from-file=auth.json=./auth.json
    • If you use a different Helm release name:

      oc create secret generic <deployment-name>-dynamic-plugins-registry-auth \
        --from-file=auth.json=./auth.json
    • If you already have Podman credentials configured locally:

      oc create secret generic <deployment-name>-dynamic-plugins-registry-auth \
        --from-file=auth.json=${XDG_RUNTIME_DIR}/containers/auth.json
    Important

    Create this secret in the same OpenShift project as your Red Hat Developer Hub deployment, and create it before you configure the plug-ins. Use a Red Hat Registry service account token, not your personal Red Hat account credentials.

Results

Verify that the secret exists in the project:

oc get secret <deployment-name>-dynamic-plugins-registry-auth

Download the Ansible plug-ins files

Download the Ansible plug-ins for Red Hat Developer Hub Setup Bundle from the Red Hat Ansible Automation Platform Product Software downloads page.

Procedure

  1. In a browser, navigate to the Red Hat Ansible Automation Platform Product Software downloads page and select the Product Software tab.
  2. Click Download now next to Ansible plug-ins for Red Hat Developer Hub Setup Bundle to download the latest version of the plug-ins.

    The format of the filename is ansible-rhdh-plugins-x.y.z.tar.gz. Substitute the Ansible plug-ins release version, for example 2.0.0, for x.y.z.

  3. Create a directory on your local machine to store the .tar files.
    $ mkdir /path/to/<ansible-backstage-plugins-local-dir-changeme>
  4. Set an environment variable ($DYNAMIC_PLUGIN_ROOT_DIR) to represent the directory path.
    $ export DYNAMIC_PLUGIN_ROOT_DIR=/path/to/<ansible-backstage-plugins-local-dir-changeme>
  5. Extract the ansible-rhdh-plugins-<version-number>.tar.gz contents to $DYNAMIC_PLUGIN_ROOT_DIR.
    $ tar --exclude='*code*' -xzf ansible-rhdh-plugins-x.y.z.tar.gz -C $DYNAMIC_PLUGIN_ROOT_DIR

    Substitute the Ansible plug-ins release version, for example 2.0.0, for x.y.z.

Results

Run ls to verify that the extracted files are in the $DYNAMIC_PLUGIN_ROOT_DIR directory:

$ ls $DYNAMIC_PLUGIN_ROOT_DIR
ansible-plugin-backstage-rhaap-dynamic-x.y.z.tgz
ansible-plugin-backstage-rhaap-dynamic-x.y.z.tgz.integrity
ansible-plugin-scaffolder-backend-module-backstage-rhaap-dynamic-x.y.z.tgz
ansible-plugin-scaffolder-backend-module-backstage-rhaap-dynamic-x.y.z.tgz.integrity

The files with the .integrity file type contain the plugin SHA value. The SHA value is used during the plug-in configuration.

Create a registry for the Ansible plug-ins

Set up a registry in your OpenShift cluster to host the Ansible plug-ins and make them available for installation in Red Hat Developer Hub (RHDH).

Procedure

  1. Log in to your OpenShift Container Platform instance with credentials to create a new application.
  2. Open your Red Hat Developer Hub OpenShift project.
    $ oc project <YOUR_DEVELOPER_HUB_PROJECT>
  3. Run the following commands to create a plug-in registry build in the OpenShift cluster.
    $ oc new-build httpd --name=plugin-registry --binary
    $ oc start-build plugin-registry --from-dir=$DYNAMIC_PLUGIN_ROOT_DIR --wait
    $ oc new-app --image-stream=plugin-registry

Results

To verify that the plugin-registry was deployed successfully, open the Topology view in the Developer perspective on the Red Hat Developer Hub application in the OpenShift Web console.

  1. Click the plug-in registry to view the log.
    Developer perspective

    (1) Developer hub instance

    (2) Plug-in registry

  2. Click the terminal tab and login to the container.
  3. In the terminal, run ls to confirm that the .tar files are in the plugin registry.
    ansible-plugin-backstage-rhaap-dynamic-x.y.z.tgz
    ansible-plugin-scaffolder-backend-module-backstage-rhaap-dynamic-x.y.z.tgz

    The version numbers and file names can differ.