Questo contenuto non è disponibile nella lingua selezionata.
Chapter 1. Installing dynamic plugins in Red Hat Developer Hub
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.
1.1. Installing dynamic plugins with the Red Hat Developer Hub Operator Copia collegamentoCollegamento copiato negli appunti!
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 <my_product_secrets> 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
1.2. Installing dynamic plugins using the Helm chart Copia collegamentoCollegamento copiato negli appunti!
You can deploy a Developer Hub instance by 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-config.yamlYAML fragment. See plugin configuration for more information. -
disabled: disables the dynamic plugin if set totrue. Default:false. -
forceDownload: Set the value totrueto force a reinstall of the plugin, bypassing the cache. The default value isfalse. pullPolicy: Similar to theforceDownloadparameter and is consistent with other image container platforms. You can use one of the following values for this key:-
Always: This value compares the image digest in the remote registry and downloads the artifact if it has changed, even if the plugin was previously downloaded. IfNotPresent: This value downloads the artifact if it is not already present in the dynamic-plugins-root folder, without checking image digests.NoteThe
pullPolicysetting is also applied to the NPM downloading method, althoughAlwayswill download the remote artifact without a digest check. The existingforceDownloadoption remains functional, however, thepullPolicyoption takes precedence. TheforceDownloadoption may be deprecated in a future Developer Hub release.
-
-
-
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.
1.2.1. Example Helm chart configurations for dynamic plugin installations Copia collegamentoCollegamento copiato negli appunti!
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 configuration
Disabling a plugin from an included file
Enabling a plugin from an included file
Enabling a plugin that is disabled in an included file
1.3. Installing dynamic plugins in an air-gapped environment Copia collegamentoCollegamento copiato negli appunti!
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. For example:
- 1
- Replace
<release_name>with your Helm release name. This name is a unique identifier for each chart installation in the Kubernetes cluster.