Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions modules/admin/proc-mount-directories-pvcs.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[id="proc-mount-directories-pvcs_{context}"]
= Mounting directories from pre-created PVCs

Starting from `v1alpha3`, you can mount directories from pre-created PersistentVolumeClaims (PVCs) using the `spec.application.extraFiles.pvcs` field.

.Prerequisites
* You have understanding of the mounting logic:
** If `spec.application.extraFiles.pvcs[].mountPath` is defined, the PVC is mounted to the specified path.
** If `spec.application.extraFiles.pvcs[].mountPath` is not defined, the PVC is mounted under the path specified in `spec.application.extraFiles.mountPath/`.
** 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.

.Procedure
. Define the PVCs using the following YAML example:
+
--
.Example YAML file to define PVCs
[source,yaml]
----
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: myclaim1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: myclaim2
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
----
--

. Use the following configuration to specify how the PVCs are mounted in the container:
+
--
.Example configuration for mounting PVCs in a container
[source,yaml]
----
spec:
application:
extraFiles:
mountPath: /my/path
pvcs:
- name: myclaim1
- name: myclaim2
mountPath: /vol/my/claim
----
--

.Verification
Based on the configuration, the following directories are mounted in the container:

* `/my/path/myclaim1`
* `/vol/my/claim`
9 changes: 6 additions & 3 deletions modules/admin/proc-rhdh-deployment-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ spec:
----

`volumes`::
Add an additional volume named `my-volume` and mount it under `/my/path` in the {product-short} application container.
+
--
Add an additional volume named `my-volume` and mount it under `/my/path` in the {product-short} application container.

.Example additional volume
[source, yaml]
----
Expand All @@ -73,9 +75,9 @@ spec:
storageClassName: "special"
name: my-volume
----
+

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.
+

.Example `dynamic-plugins-root` volume replacement
[source, yaml]
----
Expand All @@ -95,6 +97,7 @@ spec:
persistentVolumeClaim:
claimName: dynamic-plugins-root
----
--

`cpu` request::

Expand Down
3 changes: 2 additions & 1 deletion titles/admin-rhdh/title-admin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ include::assemblies/assembly-admin-templates.adoc[leveloffset=+1]
include::assemblies/assembly-techdocs-plugin.adoc[leveloffset=+1]

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