Chapter 4. Extensions in Red Hat Developer Hub
These features are for Technology Preview only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and Red Hat does not recommend using them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information on Red Hat Technology Preview features, see Technology Preview Features Scope.
Red Hat Developer Hub (RHDH) includes the Extensions feature which is preinstalled and enabled by default. Extensions provides users with a centralized interface to browse and manage available plugins
You can use Extensions to discover plugins that extend RHDH functionality, streamline development workflows, and improve the developer experience.
4.1. Viewing available plugins Copy linkLink copied to clipboard!
You can view plugins available for your Red Hat Developer Hub application on the Extensions page.
Procedure
- Open your Developer Hub application and click Administration > Extensions.
Go to the Catalog tab to view a list of available plugins and related information.
4.2. 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 > Extensions.
- Go to the Installed tab to view a list of installed plugins and related information.
4.3. Search and filter the plugins Copy linkLink copied to clipboard!
4.3.1. Search by plugin name Copy linkLink copied to clipboard!
You can use the search bar in the header to filter the Extensions plugin cards by name. For example, if you type “A” into the search bar, Extensions shows only the plugins that contain the letter “A” in the Name field.
Optionally, you can use the search bar in conjunction with a filter to filter only plugins of the selected filter by name. For example, you can apply the Category filter and then type a character into the search bar to view only Openshift plugins that contain the typed character in the name.
The following filters are available:
- Category
- Author
- Support type
4.4. Removing Extensions Copy linkLink copied to clipboard!
The Extensions feature plugins are preinstalled in Red Hat Developer Hub (RHDH) and enabled by default. If you want to remove Extensions from your RHDH instance, you can disable the relevant plugins.
Procedure
To disable the the Extensions feature plugins, edit your
dynamic-plugins.yamlwith the following content.dynamic-plugins.yamlfragmentplugins: - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace disabled: true - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace-dynamic disabled: true - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic disabled: true
If you disable the Extensions feature plugins, the Catalog and Installed tabs will also be removed. You can still view installed plugins by clicking on Administration > Extensions.
4.5. Managing plugins by using Extensions Copy linkLink copied to clipboard!
You can install and configure plugins by using Extensions.
Installation and configuration of plugins by using Extensions will only work in development environments. This feature is not supported in production environments.
In a production environment, users will be notified that plugin installation is not permitted.
In a development environment:
- Administrators can install a plugin using the default configuration preloaded in the editor, or modify the configuration before installing. Upon successful installation, users will be notified that a backend restart is required to complete the installation process.
When a plugin is installed, administrators can access the Actions drop-down in the side panel of the plugin. Available actions include:
- Editing the configuration used during installation
- Disabling or enabling the plugin
- After performing any of these actions, users will be notified that a backend restart is required for the changes to take effect.
4.5.1. Configuring RBAC to manage Extensions Copy linkLink copied to clipboard!
You can add Extensions permissions by creating or updating and existing RBAC role. For more information about using RBAC to manage role-based controls, see Managing role-based access controls (RBAC) using the Red Hat Developer Hub Web UI.
4.5.1.1. Creating a role in the Developer Hub UI to manage Extensions Copy linkLink copied to clipboard!
Prerequisites
- You have enabled RBAC, have a policy administrator role in Developer Hub, and have added plugins with permission.
Procedure
Go to Administration at the bottom of the sidebar in the Developer Hub.
The RBAC tab appears, displaying all the created roles in the Developer Hub.
- Click Create to create a role.
- Enter the user name and description (optional) of role in the given fields and click Next.
- In Add users and groups, select the user name, and click Next.
- In Add permission policies, select Extensions from the plugins dropdown.
- Expand Extensions, select both the Create and Read permissions for the Extensions plugin and click Next.
Click Create to create the role.
Verification
After you refresh the RHDH application, when you select a plugin, the Actions drop-down is active. When you click the Actions drop-down, you can edit the the plugin configuration, and enable or disable the plugin.
4.5.2. Configuring RHDH to install plugins by using Extensions Copy linkLink copied to clipboard!
When you install a plugin using Extensions UI, the configuration that you use is saved to a dynamic-plugins.extensions.yaml file within the dynamic-plugins-root persistent volume. This ensures the configuration is available when you restart the application, allowing you to edit or re-enable the plugin.
You must create a persistent volume claim (PVC) to ensure that the cache persists when you restart the RHDH application. For more information about using the dynamic plugins cache, see Using the dynamic plugins cache.
Prerequisites
- You have created a persistent volume claim (PVC) for the dynamic plugins cache with the name dynamic-plugins-root.
- You have installed Red Hat Developer Hub using the Helm chart or the Operator.
-
You have installed the OpenShift CLI (
oc).
Procedure
Create the extensions configuration file and save it as
dynamic-plugins.extensions.yaml. For example:includes: - dynamic-plugins.default.yaml plugins: - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace disabled: false pluginConfig: dynamicPlugins: frontend: red-hat-developer-hub.backstage-plugin-marketplace: appIcons: - name: marketplace importName: MarketplaceIcon dynamicRoutes: - path: /extensions/catalog importName: DynamicMarketplacePluginRouter mountPoints: - mountPoint: application/provider importName: InstallationContextProvider - mountPoint: internal.plugins/tab importName: DynamicMarketplacePluginContent config: path: marketplace title: Catalog icon: CatalogTabIcon - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic disabled: false pluginConfig: extensions: installation: enabled: true saveToSingleFile: file: /opt/app-root/src/dynamic-plugins-root/dynamic-plugins.extensions.yamlCopy the file to your cluster by running the following commands:
oc get pods -n <your-namespace> oc cp ./dynamic-plugins.extensions.yaml <your-namespace>/<pod-name>:/opt/app-root/src/dynamic-plugins-root/dynamic-plugins.extensions.yamlUpdate your RHDH application to use this file:
For operator-based installations:
Update your Backstage CR to update the
NODE_ENVenvironment variable todevelopment, as follows:apiVersion: rhdh.redhat.com/v1alpha3 kind: Backstage metadata: name: developer-hub namespace: rhdh spec: application: dynamicPluginsConfigMapName: dynamic-plugins-rhdh extraEnvs: envs: - name: NODE_ENV value: "development" secrets: - name: secrets-rhdh extraFiles: mountPath: /opt/app-root/src route: enabled: true database: enableLocalDb: trueUpdate your
dynamic-plugins-rhdhconfig map to include your extensions configuration file, as follows:kind: ConfigMap apiVersion: v1 metadata: name: dynamic-plugins-rhdh namespace: rhdh data: dynamic-plugins.yaml: | includes: - dynamic-plugins.default.yaml - /dynamic-plugins-root/dynamic-plugins.extensions.yaml plugins: []
For Helm chart installations:
Upgrade the Helm release to include your extensions configuration file and update the
NODE_ENVenvironment variable todevelopment:global: auth: backend: enabled: true clusterRouterBase: apps.<clusterName>.com dynamic: includes: - dynamic-plugins.default.yaml - /dynamic-plugins-root/dynamic-plugins.extensions.yaml upstream: backstage: extraEnvVars: - name: NODE_ENV value: development- Click Upgrade
Verification
Enable a plugin by using the Extensions UI, restart your RHDH application and refresh the UI to confirm that the plugin is enabled.
4.5.3. Configuring RHDH Local to install plugins by using Extensions Copy linkLink copied to clipboard!
You can use RHDH Local to test installing plugins by using Extensions.
Prerequisites
- You have installed RHDH Local. For more information about setting up RHDH Local, see Test locally with Red Hat Developer Hub.
Procedure
Update your
dynamic-plugins.override.yamlfile:includes: - dynamic-plugins.default.yaml plugins: - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace disabled: false pluginConfig: dynamicPlugins: frontend: red-hat-developer-hub.backstage-plugin-marketplace: appIcons: - name: marketplace importName: MarketplaceIcon dynamicRoutes: - path: /extensions/catalog importName: DynamicMarketplacePluginRouter mountPoints: - mountPoint: application/provider importName: InstallationContextProvider - mountPoint: internal.plugins/tab importName: DynamicMarketplacePluginContent config: path: marketplace title: Catalog - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic disabled: false pluginConfig: extensions: installation: enabled: true saveToSingleFile: file: /opt/app-root/src/configs/dynamic-plugins/dynamic-plugins.override.yamlUpdate your
compose.yamlfile:rhdh: container_name: rhdh environment: NODE_OPTIONS: "--inspect=0.0.0.0:9229" NODE_ENV: "development"
Verification
Enable a plugin by using the Extensions UI, restart your RHDH application and refresh the UI to confirm that the plugin is enabled.
4.5.4. Installing plugins by using Extensions Copy linkLink copied to clipboard!
You can install and configure plugins by using Extensions.
Prerequisites
- You have configured RHDH to allow plugins installation from Extensions.
- You have configured RBAC to allow the current user to manage plugin configuration.
Procedure
- Navigate to Extensions.
- Select a plugin to install.
Click the Install button.
The code editor is displayed which displays the plugin default configuration.
Update the plugin configuration, if necessary.
- Click Install
To view the plugins that require a restart, click View plugins in the alert message.
- Restart your RHDH application.
Verification
- After you restart your RHDH application, navigate to Extensions.
- Select the plugin that you have installed.
- The Actions button is displayed.
4.5.5. Enabling and disabling plugins by using Extensions Copy linkLink copied to clipboard!
Prerequisites
- You have configured RHDH to allow plugins installation from Extensions.
- You have configured RBAC to allow the current user to access to manage plugin configuration.
Procedure
- Navigate to Extensions.
- Select a plugin to enable or disable.
Click on the Enable/Disable slider.
To view the plugins that require a restart, click View plugins in the alert message.
- Restart your RHDH application.
Verification
- After you restart your RHDH application, navigate to Extensions.
- Select the plugin that you have installed.
- The Enable/Disable slider is updated.