This documentation is for a release that is no longer maintained
See documentation for the latest supported version.Installing and viewing dynamic plugins
Abstract
Preface Copy linkLink copied to clipboard!
The dynamic plugin support is based on the backend plugin manager package, which is a service that scans a configured root directory (dynamicPlugins.rootDirectory in the app-config.yaml file) for dynamic plugin packages and loads them dynamically.
You can use the dynamic plugins that come preinstalled with Red Hat Developer Hub or install external dynamic plugins from a public NPM registry.
Chapter 1. Installing dynamic plugins with the Red Hat Developer Hub Operator Copy linkLink copied to clipboard!
You can store the configuration for dynamic plugins in a ConfigMap object that your Backstage custom resource (CR) can reference.
If the pluginConfig field references environment variables, you must define the variables in your secrets-rhdh secret.
Procedure
- From the OpenShift Container Platform web console, select the ConfigMaps tab.
- Click Create ConfigMap.
From the Create ConfigMap page, select the YAML view option in Configure via and edit the file, if needed.
Example
ConfigMapobject using the GitHub dynamic pluginCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Create.
- Go to the Topology view.
Click on the overflow menu for the Red Hat Developer Hub instance that you want to use and select Edit Backstage to load the YAML view of the Red Hat Developer Hub instance.
Add the
dynamicPluginsConfigMapNamefield to yourBackstageCR. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Save.
- Navigate back to the Topology view and wait for the Red Hat Developer Hub pod to start.
- Click the Open URL icon to start using the Red Hat Developer Hub platform with the new configuration changes.
Verification
Ensure that the dynamic plugins configuration has been loaded, by appending
/api/dynamic-plugins-info/loaded-pluginsto your Red Hat Developer Hub root URL and checking the list of plugins:Example list of plugins
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 2. Installing dynamic plugins using the Helm chart Copy linkLink copied to clipboard!
You can deploy a Developer Hub instance using a Helm chart, which is a flexible installation method. With the Helm chart, you can sideload dynamic plugins into your Developer Hub instance without having to recompile your code or rebuild the container.
To install dynamic plugins in Developer Hub using Helm, add the following global.dynamic parameters in your Helm chart:
plugins: the dynamic plugins list intended for installation. By default, the list is empty. You can populate the plugins list with the following fields:-
package: a package specification for the dynamic plugin package that you want to install. You can use a package for either a local or an external dynamic plugin installation. For a local installation, use a path to the local folder containing the dynamic plugin. For an external installation, use a package specification from a public NPM repository. -
integrity(required for external packages): an integrity checksum in the form of<alg>-<digest>specific to the package. Supported algorithms includesha256,sha384andsha512. -
pluginConfig: an optional plugin-specificapp-configYAML fragment. See plugin configuration for more information. -
disabled: disables the dynamic plugin if set totrue. Default:false.
-
-
includes: a list of YAML files utilizing the same syntax.
The plugins list in the includes file is merged with the plugins list in the main Helm values. If a plugin package is mentioned in both plugins lists, the plugins fields in the main Helm values override the plugins fields in the includes file. The default configuration includes the dynamic-plugins.default.yaml file, which contains all of the dynamic plugins preinstalled in Developer Hub, whether enabled or disabled by default.
2.1. Obtaining the integrity checksum Copy linkLink copied to clipboard!
To obtain the integrity checksum, enter the following command:
npm view <package name>@<version> dist.integrity
npm view <package name>@<version> dist.integrity
2.2. Example Helm chart configurations for dynamic plugin installations Copy linkLink copied to clipboard!
The following examples demonstrate how to configure the Helm chart for specific types of dynamic plugin installations.
Configuring a local plugin and an external plugin when the external plugin requires a specific app-config
Disabling a plugin from an included file
Enabling a plugin from an included file
Enabling a plugin that is disabled in an included file
2.3. Installing external dynamic plugins using a Helm chart Copy linkLink copied to clipboard!
The NPM registry contains external dynamic plugins that you can use for demonstration purposes. For example, the following community plugins are available in the janus-idp organization in the NPMJS repository:
- Notifications (frontend and backend)
- Kubernetes actions (scaffolder actions)
To install the Notifications and Kubernetes actions plugins, include them in the Helm chart values in the global.dynamic.plugins list as shown in the following example:
Chapter 3. Installing dynamic plugins in an air-gapped environment Copy linkLink copied to clipboard!
You can install external plugins in an air-gapped environment by setting up a custom NPM registry.
You can configure the NPM registry URL and authentication information for dynamic plugin packages using a Helm chart. For dynamic plugin packages obtained through npm pack, you can use a .npmrc file.
Using the Helm chart, add the .npmrc file to the NPM registry by creating a secret named dynamic-plugins-npmrc with the following content:
Chapter 4. Viewing installed plugins Copy linkLink copied to clipboard!
Using the Dynamic Plugins Info front-end plugin, you can view plugins that are currently installed in your Red Hat Developer Hub application. This plugin is enabled by default.
Procedure
- Open your Developer Hub application and click Administration.
- Go to the Plugins tab to view a list of installed plugins and related information.