diff --git a/assemblies/assembly-configuring-default-secret-pvc-mounts.adoc b/assemblies/assembly-configuring-default-secret-pvc-mounts.adoc new file mode 100644 index 0000000000..af8710113c --- /dev/null +++ b/assemblies/assembly-configuring-default-secret-pvc-mounts.adoc @@ -0,0 +1,9 @@ +:_mod-docs-content-type: ASSEMBLY +[id="assembly-configuring-default-secret-pvc-mounts_{context}"] += Configuring default mounts for Secrets and PVCs + +You can configure Persistent Volume Claims (PVCs) and Secrets mount in your {product} deployment. Use annotations to define the custom mount paths and specify the containers to mount them to. + +include::modules/configuring-external-databases/proc-configuring-mount-paths.adoc[leveloffset=+1] + +include::modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc[leveloffset=+1] \ No newline at end of file diff --git a/modules/configuring-external-databases/proc-configuring-mount-paths.adoc b/modules/configuring-external-databases/proc-configuring-mount-paths.adoc new file mode 100644 index 0000000000..42d9279d4b --- /dev/null +++ b/modules/configuring-external-databases/proc-configuring-mount-paths.adoc @@ -0,0 +1,40 @@ +:_mod-docs-content-type: PROCEDURE +[id="proc-configuring-mount-paths_{context}"] += Configuring mount paths for Secrets and PVCs + +By default, the mount path is the working directory of the {product-short} container. If you do not define the mount path, it defaults to `/opt/app-root/src`. + +.Procedure + +. To specify a PVC mount path, add the `rhdh.redhat.com/mount-path` annotation to your configuration file as shown in the following example: ++ +.Example specifying where the PVC mounts +[source,yaml,subs="+attributes,+quotes"] +---- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: __ + annotations: + rhdh.redhat.com/mount-path: /mount/path/from/annotation +---- +where: + +`rhdh.redhat.com/mount-path`:: Specifies which mount path the PVC mounts to (in this case, `/mount/path/from/annotation` directory). +__:: Specifies the PVC to mount. + +. To specify a Secret mount path, add the `rhdh.redhat.com/mount-path` annotation to your configuration file as shown in the following example: ++ +.Example specifying where the Secret mounts +[source,yaml,subs="+attributes,+quotes"] +---- +apiVersion: v1 +kind: Secret +metadata: + name: __ + annotations: + rhdh.redhat.com/mount-path: /mount/path/from/annotation +---- +where: + +__:: Specifies the Secret name. \ No newline at end of file diff --git a/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc b/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc new file mode 100644 index 0000000000..b5f04c1b04 --- /dev/null +++ b/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc @@ -0,0 +1,43 @@ +:_mod-docs-content-type: PROCEDURE +[id="proc-mounting-to-specific-containers_{context}"] += Mounting Secrets and PVCs to specific containers + +By default, Secrets and PVCs mount only to the {product} `backstage-backend` container. You can add the `rhdh.redhat.com/containers` annotation to your configuration file to specify the containers to mount to. + +.Procedure + +. To mount Secrets to *all* containers, set the `rhdh.redhat.com/containers` annotation to `*` in your configuration file: ++ +.Example mounting to all containers +[source,yaml,subs="+attributes,+quotes"] +---- +apiVersion: v1 +kind: Secret +metadata: + name: __ + annotations: + rhdh.redhat.com/containers: `*` +---- ++ +[IMPORTANT] +==== +Set `rhdh.redhat.com/containers` to `*` to mount it to all containers in the deployment. +==== + +. To mount to specific containers, separate the names with commas: ++ +.Example separating the list of containers +[source,yaml,subs="+attributes,+quotes"] +---- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: __ + annotations: + rhdh.redhat.com/containers: "init-dynamic-plugins,backstage-backend" +---- ++ +[NOTE] +==== +This configuration mounts the `__` PVC to the `init-dynamic-plugins` and `backstage-backend` containers. +==== \ No newline at end of file diff --git a/titles/configuring/master.adoc b/titles/configuring/master.adoc index 73ab3513eb..e2d611561f 100644 --- a/titles/configuring/master.adoc +++ b/titles/configuring/master.adoc @@ -33,5 +33,8 @@ include::modules/installation/proc-configuring-an-rhdh-instance-with-tls-in-kube include::modules/dynamic-plugins/con-dynamic-plugins-cache.adoc[ leveloffset=+1] +include::assemblies/assembly-configuring-default-secret-pvc-mounts.adoc[leveloffset=+1] + + include::modules/dynamic-plugins/proc-installing-and-configuring-redis-cache.adoc[leveloffset=+1]