Skip to content

RHIDP-5515: Document default PVC and Secret configuration update #1067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:_mod-docs-content-type: ASSEMBLY
[id="assembly-configuring-default-secret-pvc-mounts_{context}"]
= Configuring default mounts for Secrets and PVCs

Check warning on line 3 in assemblies/assembly-configuring-default-secret-pvc-mounts.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [RedHat.Spelling] Verify the word 'PVCs'. It is not in the American English spelling dictionary used by Vale. Raw Output: {"message": "[RedHat.Spelling] Verify the word 'PVCs'. It is not in the American English spelling dictionary used by Vale.", "location": {"path": "assemblies/assembly-configuring-default-secret-pvc-mounts.adoc", "range": {"start": {"line": 3, "column": 46}}}, "severity": "WARNING"}

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.

Check warning on line 5 in assemblies/assembly-configuring-default-secret-pvc-mounts.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [RedHat.Spelling] Verify the word 'PVCs'. It is not in the American English spelling dictionary used by Vale. Raw Output: {"message": "[RedHat.Spelling] Verify the word 'PVCs'. It is not in the American English spelling dictionary used by Vale.", "location": {"path": "assemblies/assembly-configuring-default-secret-pvc-mounts.adoc", "range": {"start": {"line": 5, "column": 45}}}, "severity": "WARNING"}

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]
Original file line number Diff line number Diff line change
@@ -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: _<my_claim>_
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).
_<my_claim>_:: 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: _<my_secret>_
annotations:
rhdh.redhat.com/mount-path: /mount/path/from/annotation
----
where:

_<my_secret>_:: Specifies the Secret name.
Original file line number Diff line number Diff line change
@@ -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: _<my_secret>_
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: _<my_claim>_
annotations:
rhdh.redhat.com/containers: "init-dynamic-plugins,backstage-backend"
----
+
[NOTE]
====
This configuration mounts the `_<my_claim>_` PVC to the `init-dynamic-plugins` and `backstage-backend` containers.
====
3 changes: 3 additions & 0 deletions titles/configuring/master.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]