Skip to content

Commit 45e8a9a

Browse files
committed
Incorporated review suggestions
1 parent fb6fcf1 commit 45e8a9a

File tree

3 files changed

+66
-53
lines changed

3 files changed

+66
-53
lines changed
Lines changed: 64 additions & 0 deletions
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 neither `mountPath` is defined, the PVC defaults to `/opt/app-root/src` or you can use {product-very-short} container working directory (if defined).
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

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -97,58 +97,6 @@ spec:
9797
persistentVolumeClaim:
9898
claimName: dynamic-plugins-root
9999
----
100-
101-
Starting from v1alpha3 (Operator version 0.4.0), you can mount directories from pre-created PVCs using the `spec.application.extraFiles.pvcs` field. PVCs are mounted as directories to the container's path, based on the following logic:
102-
103-
* If `spec.application.extraFiles.pvcs[].mountPath` is defined, the PVC is mounted to the specified path.
104-
* If `spec.application.extraFiles.pvcs[].mountPath` is not defined, the PVC is mounted under `spec.application.extraFiles.mountPath/`.
105-
* If neither is defined, the PVC defaults to `/opt/app-root/src`.
106-
107-
.Example PVC objects in the namespace
108-
[source,yaml]
109-
----
110-
apiVersion: v1
111-
kind: PersistentVolumeClaim
112-
metadata:
113-
name: myclaim1
114-
spec:
115-
accessModes:
116-
- ReadWriteOnce
117-
resources:
118-
requests:
119-
storage: 2Gi
120-
---
121-
apiVersion: v1
122-
kind: PersistentVolumeClaim
123-
metadata:
124-
name: myclaim2
125-
spec:
126-
accessModes:
127-
- ReadWriteOnce
128-
resources:
129-
requests:
130-
storage: 2Gi
131-
----
132-
133-
The PVCs in the previous example can be mounted to the container as follows:
134-
135-
.Example PVCs mounted to the container
136-
[source,yaml]
137-
----
138-
spec:
139-
application:
140-
extraFiles:
141-
mountPath: /my/path
142-
pods:
143-
- name: myclaim1
144-
- name: myclaim2
145-
mountPath: /vol/my/claim
146-
----
147-
148-
As a result, the following directories are mounted in the container:
149-
150-
* `/my/path/myclaim1`
151-
* `/vol/my/claim`
152100
--
153101

154102
`cpu` request::

titles/admin-rhdh/title-admin.adoc

Lines changed: 2 additions & 1 deletion
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)