이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 8. Using the dynamic plugins cache
8.1. Using the dynamic plugins cache 링크 복사링크가 클립보드에 복사되었습니다!
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 링크 복사링크가 클립보드에 복사되었습니다!
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:kind: PersistentVolumeClaim apiVersion: v1 metadata: name: dynamic-plugins-root spec: accessModes: - ReadWriteOnce resources: requests: storage: 5GiNoteThis 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.yamlReplace the default
dynamic-plugins-rootvolume with a PVC nameddynamic-plugins-root. For example:apiVersion: rhdh.redhat.com/v1alpha3 kind: Backstage metadata: name: developer-hub spec: deployment: patch: spec: template: spec: volumes: - $patch: replace name: dynamic-plugins-root persistentVolumeClaim: claimName: dynamic-plugins-rootNoteTo 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 링크 복사링크가 클립보드에 복사되었습니다!
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:
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: dynamic-plugins-root spec: accessModes: - ReadWriteOnce resources: requests: storage: 5GiNoteThis 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.yamlConfigure the Helm chart to use the PVC. For example:
upstream: backstage: extraVolumes: - name: dynamic-plugins-root persistentVolumeClaim: claimName: dynamic-plugins-root - name: dynamic-plugins configMap: defaultMode: 420 name: '{{ printf "%s-dynamic-plugins" .Release.Name }}' optional: true - name: dynamic-plugins-npmrc secret: defaultMode: 420 optional: true secretName: '{{ printf "%s-dynamic-plugins-npmrc" .Release.Name }}' - name: dynamic-plugins-registry-auth secret: defaultMode: 416 optional: true secretName: '{{ printf "%s-dynamic-plugins-registry-auth" .Release.Name }}' - name: npmcacache emptyDir: {} - name: temp emptyDir: {}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 링크 복사링크가 클립보드에 복사되었습니다!
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'