Skip to content

Commit 549280d

Browse files
authored
RHIDP-5570-2 - Document that the Dynamic Plugin cache PVC is disabled by default (redhat-developer#998)
1 parent 9b2dcf2 commit 549280d

File tree

1 file changed

+90
-5
lines changed

1 file changed

+90
-5
lines changed

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

+90-5
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ When you enable dynamic plugins cache:
1313
== Enabling the dynamic plugins cache
1414
To enable the dynamic plugins cache in {product-very-short}, the plugins directory `dynamic-plugins-root` must be a persistent volume.
1515

16-
For Helm chart installations, a persistent volume named `dynamic-plugins-root` is automatically created.
16+
=== Creating a PVC for the dynamic plugin cache by using the Operator
1717

18-
For operator-based installations, you must manually create the PersistentVolumeClaim (PVC) as follows:
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`.
1919

20+
.Procedure
21+
. Create the persistent volume definition and save it to a file, such as `pvc.yaml`. For example:
22+
+
2023
[source,yaml]
2124
----
2225
kind: PersistentVolumeClaim
@@ -30,8 +33,23 @@ spec:
3033
requests:
3134
storage: 5Gi
3235
33-
---
34-
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+
----
3553
apiVersion: rhdh.redhat.com/v1alpha3
3654
kind: Backstage
3755
metadata:
@@ -48,10 +66,77 @@ spec:
4866
persistentVolumeClaim:
4967
claimName: dynamic-plugins-root
5068
----
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.
5175

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+
+
93+
[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+
Gerry-Forde marked this conversation as resolved.
98+
====
99+
100+
. To apply this PVC to your cluster, run the following command:
101+
+
102+
[source,terminal]
103+
----
104+
oc apply -f pvc.yaml
105+
----
106+
. Configure the Helm chart to use the PVC. For example:
107+
+
108+
[source,yaml]
109+
----
110+
upstream:
111+
backstage:
112+
extraVolumes:
113+
- name: dynamic-plugins-root
114+
persistentVolumeClaim:
115+
claimName: dynamic-plugins-root
116+
- name: dynamic-plugins
117+
configMap:
118+
defaultMode: 420
119+
name: '{{ printf "%s-dynamic-plugins" .Release.Name }}'
120+
optional: true
121+
- name: dynamic-plugins-npmrc
122+
secret:
123+
defaultMode: 420
124+
optional: true
125+
secretName: '{{ printf "%s-dynamic-plugins-npmrc" .Release.Name }}'
126+
- name: dynamic-plugins-registry-auth
127+
secret:
128+
defaultMode: 416
129+
optional: true
130+
secretName: '{{ printf "%s-dynamic-plugins-registry-auth" .Release.Name }}'
131+
- name: npmcacache
132+
emptyDir: {}
133+
- name: temp
134+
emptyDir: {}
135+
----
136+
+
52137
[NOTE]
53138
====
54-
Future versions of the {product-very-short} operator are planned to automatically create the PVC.
139+
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.
55140
====
56141

57142
== Configuring the dynamic plugins cache

0 commit comments

Comments
 (0)