Skip to content

Commit f1bde16

Browse files
committed
RHIDP-4566: document how to manage PVCs in RHDH operator
1 parent 0c9aec5 commit f1bde16

File tree

1 file changed

+58
-3
lines changed

1 file changed

+58
-3
lines changed

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

Lines changed: 58 additions & 3 deletions
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
----
@@ -96,6 +98,59 @@ spec:
9698
claimName: dynamic-plugins-root
9799
----
98100

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`
152+
--
153+
99154
`cpu` request::
100155

101156
Set the CPU request for the {product-short} application container to 250m.

0 commit comments

Comments
 (0)