diff --git a/modules/admin/proc-mount-directories-pvcs.adoc b/modules/admin/proc-mount-directories-pvcs.adoc new file mode 100644 index 0000000000..61cc8a6e59 --- /dev/null +++ b/modules/admin/proc-mount-directories-pvcs.adoc @@ -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` \ No newline at end of file diff --git a/modules/admin/proc-rhdh-deployment-config.adoc b/modules/admin/proc-rhdh-deployment-config.adoc index 47b44e98b0..29a866bea7 100644 --- a/modules/admin/proc-rhdh-deployment-config.adoc +++ b/modules/admin/proc-rhdh-deployment-config.adoc @@ -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] ---- @@ -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] ---- @@ -95,6 +97,7 @@ spec: persistentVolumeClaim: claimName: dynamic-plugins-root ---- +-- `cpu` request:: diff --git a/titles/admin-rhdh/title-admin.adoc b/titles/admin-rhdh/title-admin.adoc index 8aaea1cac5..f35bdaa36c 100644 --- a/titles/admin-rhdh/title-admin.adoc +++ b/titles/admin-rhdh/title-admin.adoc @@ -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]