Skip to content

Commit 4f1e195

Browse files
Gerry-Fordejmagak
andauthored
RHIDP-6501 - Modularize modules/dynamic-plugins/con-dynamic-plugins-cache.adoc (#1179)
* RHIDP-6501 - Modularize modules/dynamic-plugins/con-dynamic-plugins-cache.adoc * RHIDP-6501 - Modularize modules/dynamic-plugins/con-dynamic-plugins-cache.adoc * RHIDP-6501 - Modularize modules/dynamic-plugins/con-dynamic-plugins-cache.adoc * RHIDP-6501 - Modularize modules/dynamic-plugins/con-dynamic-plugins-cache.adoc * Update modules/dynamic-plugins/proc-creating-a-pvc-for-the-dynamic-plugin-cache-by-using-the-operator.adoc Co-authored-by: Judith Magak <[email protected]> * Update modules/dynamic-plugins/proc-creating-a-pvc-for-the-dynamic-plugin-cache-by-using-helm.adoc Co-authored-by: Judith Magak <[email protected]> --------- Co-authored-by: Judith Magak <[email protected]>
1 parent 468a1a6 commit 4f1e195

6 files changed

+166
-152
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[id="using-the-dynamic-plugins-cache_{context}"]
2+
= Using the dynamic plugins cache
3+
4+
include::../modules/dynamic-plugins/con-dynamic-plugins-cache.adoc[leveloffset=+1]
5+
include::../modules/dynamic-plugins/proc-creating-a-pvc-for-the-dynamic-plugin-cache-by-using-the-operator.adoc[leveloffset=+1]
6+
include::../modules/dynamic-plugins/proc-creating-a-pvc-for-the-dynamic-plugin-cache-by-using-helm.adoc[leveloffset=+1]
7+
include::../modules/dynamic-plugins/ref-configuring-the-dynamic-plugins-cache.adoc[leveloffset=+1]

modules/dynamic-plugins/con-dynamic-plugins-cache.adoc

Lines changed: 1 addition & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -10,153 +10,5 @@ When you enable dynamic plugins cache:
1010
* During boot, if a plugin's package reference matches the previous installation and the checksum is unchanged, the download is skipped.
1111
* Plugins that are disabled since the previous boot are automatically removed.
1212

13-
== Enabling the dynamic plugins cache
14-
To enable the dynamic plugins cache in {product-very-short}, the plugins directory `dynamic-plugins-root` must be a persistent volume.
15-
16-
=== Creating a PVC for the dynamic plugin cache by using the Operator
17-
18-
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`.
19-
20-
.Procedure
21-
. Create the persistent volume definition and save it to a file, such as `pvc.yaml`. For example:
22-
+
23-
[source,yaml]
24-
----
25-
kind: PersistentVolumeClaim
26-
apiVersion: v1
27-
metadata:
28-
name: dynamic-plugins-root
29-
spec:
30-
accessModes:
31-
- ReadWriteOnce
32-
resources:
33-
requests:
34-
storage: 5Gi
35-
36-
----
37-
+
38-
[NOTE]
39-
====
40-
This example uses `ReadWriteOnce` as the access mode which prevents multiple replicas from sharing the PVC across different nodes.
41-
To run multiple replicas on different nodes, depending on your storage driver, you must use an access mode such as `ReadWriteMany`.
42-
====
43-
. To apply this PVC to your cluster, run the following command:
44-
+
45-
[source,terminal]
46-
----
47-
oc apply -f pvc.yaml
48-
----
49-
. Replace the default `dynamic-plugins-root` volume with a PVC named `dynamic-plugins-root`. For example:
50-
+
51-
[source,yaml]
52-
----
53-
apiVersion: rhdh.redhat.com/v1alpha3
54-
kind: Backstage
55-
metadata:
56-
name: developer-hub
57-
spec:
58-
deployment:
59-
patch:
60-
spec:
61-
template:
62-
spec:
63-
volumes:
64-
- $patch: replace
65-
name: dynamic-plugins-root
66-
persistentVolumeClaim:
67-
claimName: dynamic-plugins-root
68-
----
69-
+
70-
[NOTE]
71-
To avoid adding a new volume, you must use the `$patch: replace` directive.
72-
73-
=== Creating a PVC for the dynamic plugin cache using the Helm Chart
74-
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.
75-
76-
.Procedure
77-
. Create the persistent volume definition. For example:
78-
+
79-
[source,yaml]
80-
----
81-
kind: PersistentVolumeClaim
82-
apiVersion: v1
83-
metadata:
84-
name: dynamic-plugins-root
85-
spec:
86-
accessModes:
87-
- ReadWriteOnce
88-
resources:
89-
requests:
90-
storage: 5Gi
91-
----
92-
+
9313
[NOTE]
94-
====
95-
This example uses `ReadWriteOnce` as the access mode which prevents multiple replicas from sharing the PVC across different nodes.
96-
To run multiple replicas on different nodes, depending on your storage driver, you must use an access mode such as `ReadWriteMany`.
97-
====
98-
99-
. To apply this PVC to your cluster, run the following command:
100-
+
101-
[source,terminal]
102-
----
103-
oc apply -f pvc.yaml
104-
----
105-
. Configure the Helm chart to use the PVC. For example:
106-
+
107-
[source,yaml]
108-
----
109-
upstream:
110-
backstage:
111-
extraVolumes:
112-
- name: dynamic-plugins-root
113-
persistentVolumeClaim:
114-
claimName: dynamic-plugins-root
115-
- name: dynamic-plugins
116-
configMap:
117-
defaultMode: 420
118-
name: '{{ printf "%s-dynamic-plugins" .Release.Name }}'
119-
optional: true
120-
- name: dynamic-plugins-npmrc
121-
secret:
122-
defaultMode: 420
123-
optional: true
124-
secretName: '{{ printf "%s-dynamic-plugins-npmrc" .Release.Name }}'
125-
- name: dynamic-plugins-registry-auth
126-
secret:
127-
defaultMode: 416
128-
optional: true
129-
secretName: '{{ printf "%s-dynamic-plugins-registry-auth" .Release.Name }}'
130-
- name: npmcacache
131-
emptyDir: {}
132-
- name: temp
133-
emptyDir: {}
134-
----
135-
+
136-
[NOTE]
137-
====
138-
When you configure the Helm chart to use the PVC, you must also include the link:https://github.com/redhat-developer/rhdh-chart/blob/release-{product-version}/charts/backstage/values.yaml#L145-L181[`extraVolumes`] defined in the default Helm chart.
139-
====
140-
141-
== Configuring the dynamic plugins cache
142-
You can set the following optional dynamic plugin cache parameters in your `dynamic-plugins.yaml` file:
143-
144-
* `forceDownload`: Set the value to `true` to force a reinstall of the plugin, bypassing the cache. The default value is `false`.
145-
146-
* `pullPolicy`: Similar to the `forceDownload` parameter and is consistent with other image container platforms. You can use one of the following values for this key:
147-
148-
** `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.
149-
** `IfNotPresent`: This value downloads the artifact if it is not already present in the dynamic-plugins-root folder, without checking image digests.
150-
+
151-
[NOTE]
152-
The `pullPolicy` setting is also applied to the NPM downloading method, although `Always` will download the remote artifact without a digest check. The existing `forceDownload` option remains functional, however, the `pullPolicy` option takes precedence. The `forceDownload` option may be deprecated in a future {product-short} release.
153-
154-
.Example `dynamic-plugins.yaml` file configuration to download the remote artifact without a digest check:
155-
156-
[source,yaml]
157-
----
158-
plugins:
159-
- disabled: false
160-
pullPolicy: Always
161-
package: 'oci://quay.io/example-org/example-plugin:v1.0.0!internal-backstage-plugin-example'
162-
----
14+
To enable the dynamic plugins cache in {product-very-short}, the plugins directory `dynamic-plugins-root` must be a persistent volume.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[id="proc-creating-a-pvc-for-the-dynamic-plugin-cache-by-using-helm_{context}"]
2+
= Creating a PVC for the dynamic plugin cache using the Helm Chart
3+
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.
4+
5+
.Prerequisites
6+
* You have installed {product} using the Helm chart.
7+
* You have installed the {openshift-cli}.
8+
9+
.Procedure
10+
. Create the persistent volume definition. For example:
11+
+
12+
[source,yaml]
13+
----
14+
kind: PersistentVolumeClaim
15+
apiVersion: v1
16+
metadata:
17+
name: dynamic-plugins-root
18+
spec:
19+
accessModes:
20+
- ReadWriteOnce
21+
resources:
22+
requests:
23+
storage: 5Gi
24+
----
25+
+
26+
[NOTE]
27+
====
28+
This example uses `ReadWriteOnce` as the access mode which prevents multiple replicas from sharing the PVC across different nodes.
29+
To run multiple replicas on different nodes, depending on your storage driver, you must use an access mode such as `ReadWriteMany`.
30+
====
31+
32+
. To apply this PVC to your cluster, run the following command:
33+
+
34+
[source,terminal]
35+
----
36+
oc apply -f pvc.yaml
37+
----
38+
. Configure the Helm chart to use the PVC. For example:
39+
+
40+
[source,yaml]
41+
----
42+
upstream:
43+
backstage:
44+
extraVolumes:
45+
- name: dynamic-plugins-root
46+
persistentVolumeClaim:
47+
claimName: dynamic-plugins-root
48+
- name: dynamic-plugins
49+
configMap:
50+
defaultMode: 420
51+
name: '{{ printf "%s-dynamic-plugins" .Release.Name }}'
52+
optional: true
53+
- name: dynamic-plugins-npmrc
54+
secret:
55+
defaultMode: 420
56+
optional: true
57+
secretName: '{{ printf "%s-dynamic-plugins-npmrc" .Release.Name }}'
58+
- name: dynamic-plugins-registry-auth
59+
secret:
60+
defaultMode: 416
61+
optional: true
62+
secretName: '{{ printf "%s-dynamic-plugins-registry-auth" .Release.Name }}'
63+
- name: npmcacache
64+
emptyDir: {}
65+
- name: temp
66+
emptyDir: {}
67+
----
68+
+
69+
[NOTE]
70+
====
71+
When you configure the Helm chart to use the PVC, you must also include the link:https://github.com/redhat-developer/rhdh-chart/blob/release-{product-version}/charts/backstage/values.yaml#L145-L181[`extraVolumes`] defined in the default Helm chart.
72+
====
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[id="proc-creating-a-pvc-for-the-dynamic-plugin-cache-by-using-the-operator_{context}"]
2+
= Creating a PVC for the dynamic plugin cache by using the Operator
3+
4+
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`.
5+
6+
.Prerequisites
7+
* You have installed {product} on {ocp-short} using the {product} Operator.
8+
* You have installed the {openshift-cli}.
9+
10+
.Procedure
11+
. Create the persistent volume definition and save it to a file, such as `pvc.yaml`. For example:
12+
+
13+
[source,yaml]
14+
----
15+
kind: PersistentVolumeClaim
16+
apiVersion: v1
17+
metadata:
18+
name: dynamic-plugins-root
19+
spec:
20+
accessModes:
21+
- ReadWriteOnce
22+
resources:
23+
requests:
24+
storage: 5Gi
25+
26+
----
27+
+
28+
[NOTE]
29+
====
30+
This example uses `ReadWriteOnce` as the access mode which prevents multiple replicas from sharing the PVC across different nodes.
31+
To run multiple replicas on different nodes, depending on your storage driver, you must use an access mode such as `ReadWriteMany`.
32+
====
33+
. To apply this PVC to your cluster, run the following command:
34+
+
35+
[source,terminal]
36+
----
37+
oc apply -f pvc.yaml
38+
----
39+
. Replace the default `dynamic-plugins-root` volume with a PVC named `dynamic-plugins-root`. For example:
40+
+
41+
[source,yaml]
42+
----
43+
apiVersion: rhdh.redhat.com/v1alpha3
44+
kind: Backstage
45+
metadata:
46+
name: developer-hub
47+
spec:
48+
deployment:
49+
patch:
50+
spec:
51+
template:
52+
spec:
53+
volumes:
54+
- $patch: replace
55+
name: dynamic-plugins-root
56+
persistentVolumeClaim:
57+
claimName: dynamic-plugins-root
58+
----
59+
+
60+
[NOTE]
61+
To avoid adding a new volume, you must use the `$patch: replace` directive.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[id="ref-configuring-the-dynamic-plugins-cache_{context}"]
2+
= Configuring the dynamic plugins cache
3+
You can set the following optional dynamic plugin cache parameters in your `dynamic-plugins.yaml` file:
4+
5+
* `forceDownload`: Set the value to `true` to force a reinstall of the plugin, bypassing the cache. The default value is `false`.
6+
7+
* `pullPolicy`: Similar to the `forceDownload` parameter and is consistent with other image container platforms. You can use one of the following values for this key:
8+
9+
** `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.
10+
** `IfNotPresent`: This value downloads the artifact if it is not already present in the dynamic-plugins-root folder, without checking image digests.
11+
+
12+
[NOTE]
13+
The `pullPolicy` setting is also applied to the NPM downloading method, although `Always` will download the remote artifact without a digest check. The existing `forceDownload` option remains functional, however, the `pullPolicy` option takes precedence. The `forceDownload` option may be deprecated in a future {product-short} release.
14+
15+
.Example `dynamic-plugins.yaml` file configuration to download the remote artifact without a digest check:
16+
17+
[source,yaml]
18+
----
19+
plugins:
20+
- disabled: false
21+
pullPolicy: Always
22+
package: 'oci://quay.io/example-org/example-plugin:v1.0.0!internal-backstage-plugin-example'
23+
----

titles/configuring/master.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ include::assemblies/assembly-configuring-a-proxy.adoc[leveloffset=+1]
3030
include::modules/installation/proc-configuring-an-rhdh-instance-with-tls-in-kubernetes.adoc[leveloffset=+1]
3131

3232

33-
include::modules/dynamic-plugins/con-dynamic-plugins-cache.adoc[ leveloffset=+1]
33+
include::assemblies/dynamic-plugins/assembly-using-the-dynamic-plugins-cache.adoc[ leveloffset=+1]
3434

3535

3636
include::assemblies/assembly-configuring-default-secret-pvc-mounts.adoc[leveloffset=+1]
3737

3838

39-
include::modules/configuring/proc-enabling-the-rhdh-plugin-assets-cache.adoc[leveloffset=+1]
40-
39+
include::modules/configuring/proc-enabling-the-rhdh-plugin-assets-cache.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)