Skip to content

Commit 108397c

Browse files
authored
RHIDP-4566: document how to manage PVCs in RHDH operator (redhat-developer#702)
* RHIDP-4566: document how to manage PVCs in RHDH operator * Incorporated review suggestions * Incorporate QE suggestion
1 parent fa54f2e commit 108397c

File tree

3 files changed

+72
-4
lines changed

3 files changed

+72
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[id="proc-mount-directories-pvcs_{context}"]
2+
= Mounting directories from pre-created PVCs
3+
4+
Starting from `v1alpha3`, you can mount directories from pre-created PersistentVolumeClaims (PVCs) using the `spec.application.extraFiles.pvcs` field.
5+
6+
.Prerequisites
7+
* You have understanding of the mounting logic:
8+
** If `spec.application.extraFiles.pvcs[].mountPath` is defined, the PVC is mounted to the specified path.
9+
** If `spec.application.extraFiles.pvcs[].mountPath` is not defined, the PVC is mounted under the path specified in `spec.application.extraFiles.mountPath/`.
10+
** If `mountPath` is not defined, the PVC defaults to `/opt/app-root/src`, or you can use the {product-very-short} container's working directory if it is specified.
11+
12+
.Procedure
13+
. Define the PVCs using the following YAML example:
14+
+
15+
--
16+
.Example YAML file to define PVCs
17+
[source,yaml]
18+
----
19+
apiVersion: v1
20+
kind: PersistentVolumeClaim
21+
metadata:
22+
name: myclaim1
23+
spec:
24+
accessModes:
25+
- ReadWriteOnce
26+
resources:
27+
requests:
28+
storage: 2Gi
29+
---
30+
apiVersion: v1
31+
kind: PersistentVolumeClaim
32+
metadata:
33+
name: myclaim2
34+
spec:
35+
accessModes:
36+
- ReadWriteOnce
37+
resources:
38+
requests:
39+
storage: 2Gi
40+
----
41+
--
42+
43+
. Use the following configuration to specify how the PVCs are mounted in the container:
44+
+
45+
--
46+
.Example configuration for mounting PVCs in a container
47+
[source,yaml]
48+
----
49+
spec:
50+
application:
51+
extraFiles:
52+
mountPath: /my/path
53+
pvcs:
54+
- name: myclaim1
55+
- name: myclaim2
56+
mountPath: /vol/my/claim
57+
----
58+
--
59+
60+
.Verification
61+
Based on the configuration, the following directories are mounted in the container:
62+
63+
* `/my/path/myclaim1`
64+
* `/vol/my/claim`

modules/admin/proc-rhdh-deployment-config.adoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ spec:
4646
----
4747

4848
`volumes`::
49-
Add an additional volume named `my-volume` and mount it under `/my/path` in the {product-short} application container.
5049
+
50+
--
51+
Add an additional volume named `my-volume` and mount it under `/my/path` in the {product-short} application container.
52+
5153
.Example additional volume
5254
[source, yaml]
5355
----
@@ -73,9 +75,9 @@ spec:
7375
storageClassName: "special"
7476
name: my-volume
7577
----
76-
+
78+
7779
Replace the default `dynamic-plugins-root` volume with a persistent volume claim (PVC) named `dynamic-plugins-root`. Note the `$patch: replace` directive, otherwise a new volume will be added.
78-
+
80+
7981
.Example `dynamic-plugins-root` volume replacement
8082
[source, yaml]
8183
----
@@ -95,6 +97,7 @@ spec:
9597
persistentVolumeClaim:
9698
claimName: dynamic-plugins-root
9799
----
100+
--
98101

99102
`cpu` request::
100103

titles/admin-rhdh/title-admin.adoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ include::assemblies/assembly-admin-templates.adoc[leveloffset=+1]
4040
include::assemblies/assembly-techdocs-plugin.adoc[leveloffset=+1]
4141

4242
// RHDH Operator deployment
43-
include::modules//admin/proc-rhdh-deployment-config.adoc[leveloffset=+1]
43+
include::modules/admin/proc-rhdh-deployment-config.adoc[leveloffset=+1]
44+
include::modules/admin/proc-mount-directories-pvcs.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)