Chapter 8. Using the dynamic plugins cache
8.1. Using the dynamic plugins cache Copy linkLink copied to clipboard!
The dynamic plugins cache in Red Hat Developer Hub (RHDH) enhances the installation process and reduces platform boot time by storing previously installed plugins. If the configuration remains unchanged, this feature prevents the need to re-download plugins on subsequent boots.
When you enable dynamic plugins cache:
-
The system calculates a checksum of each plugin’s YAML configuration (excluding
pluginConfig). -
The checksum is stored in a file named
dynamic-plugin-config.hashwithin the plugin’s directory. - During boot, if a plugin’s package reference matches the previous installation and the checksum is unchanged, the download is skipped.
- Plugins that are disabled since the previous boot are automatically removed.
To enable the dynamic plugins cache in RHDH, the plugins directory dynamic-plugins-root must be a persistent volume.
8.2. Creating a PVC for the dynamic plugin cache by using the Operator Copy linkLink copied to clipboard!
For operator-based installations, you must manually create the persistent volume claim (PVC) by replacing the default dynamic-plugins-root volume with a PVC named dynamic-plugins-root.
Prerequisites
- You have installed Red Hat Developer Hub on OpenShift Container Platform using the Red Hat Developer Hub Operator.
-
You have installed the OpenShift CLI (
oc).
Procedure
Create the persistent volume definition and save it to a file, such as
pvc.yaml. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThis example uses
ReadWriteOnceas the access mode which prevents multiple replicas from sharing the PVC across different nodes. To run multiple replicas on different nodes, depending on your storage driver, you must use an access mode such asReadWriteMany.To apply this PVC to your cluster, run the following command:
oc apply -f pvc.yaml
oc apply -f pvc.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the default
dynamic-plugins-rootvolume with a PVC nameddynamic-plugins-root. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteTo avoid adding a new volume, you must use the
$patch: replacedirective.
8.3. Creating a PVC for the dynamic plugin cache using the Helm Chart Copy linkLink copied to clipboard!
For Helm chart installations, if you require the dynamic plugin cache to persist across pod restarts, you must create a persistent volume claim (PVC) and configure the Helm chart to use it.
Prerequisites
- You have installed Red Hat Developer Hub using the Helm chart.
-
You have installed the OpenShift CLI (
oc).
Procedure
Create the persistent volume definition. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThis example uses
ReadWriteOnceas the access mode which prevents multiple replicas from sharing the PVC across different nodes. To run multiple replicas on different nodes, depending on your storage driver, you must use an access mode such asReadWriteMany.To apply this PVC to your cluster, run the following command:
oc apply -f pvc.yaml
oc apply -f pvc.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the Helm chart to use the PVC. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteWhen you configure the Helm chart to use the PVC, you must also include the
extraVolumesdefined in the default Helm chart.
8.4. Configuring the dynamic plugins cache Copy linkLink copied to clipboard!
You can set the following optional dynamic plugin cache parameters in your dynamic-plugins.yaml file:
-
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.
-
Example dynamic-plugins.yaml file configuration to download the remote artifact without a digest check:
plugins:
- disabled: false
pullPolicy: Always
package: 'oci://quay.io/example-org/example-plugin:v1.0.0!internal-backstage-plugin-example'
plugins:
- disabled: false
pullPolicy: Always
package: 'oci://quay.io/example-org/example-plugin:v1.0.0!internal-backstage-plugin-example'