Skip to content

Commit caab4cd

Browse files
author
GitHub Actions
committed
Default pvc and secret config
1 parent f5ac51b commit caab4cd

File tree

4 files changed

+119
-0
lines changed

4 files changed

+119
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="assembly-configuring-default-secret-pvc-mounts_{context}"]
3+
= Configuring default mounts for Secrets and PVCs
4+
5+
You can configure where 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.
6+
7+
include::modules/configuring-external-databases/proc-configuring-mount-paths.adoc[leveloffset=+1]
8+
9+
include::modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc[leveloffset=+1]
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[id="proc-mount-directories-pvcs_{context}"]
2+
= Mounting directories from pre-created PVCs
3+
4+
Starting from `v1alpha3`, you can mount directories from pre-created PersistentVolumeClaims (PVCs) using the `spec.application.extraFiles.pvcs` field.
5+
6+
.Prerequisites
7+
* You have understanding of the mounting logic:
8+
** If `spec.application.extraFiles.pvcs[].mountPath` is defined, the PVC is mounted to the specified path.
9+
** If `spec.application.extraFiles.pvcs[].mountPath` is not defined, the PVC is mounted under the path specified in `spec.application.extraFiles.mountPath/`.
10+
** 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.
11+
12+
.Procedure
13+
. Define the PVCs using the following YAML example:
14+
+
15+
--
16+
.Example YAML file to define PVCs
17+
[source,yaml]
18+
----
19+
apiVersion: v1
20+
kind: PersistentVolumeClaim
21+
metadata:
22+
name: myclaim1
23+
spec:
24+
accessModes:
25+
- ReadWriteOnce
26+
resources:
27+
requests:
28+
storage: 2Gi
29+
---
30+
apiVersion: v1
31+
kind: PersistentVolumeClaim
32+
metadata:
33+
name: myclaim2
34+
spec:
35+
accessModes:
36+
- ReadWriteOnce
37+
resources:
38+
requests:
39+
storage: 2Gi
40+
----
41+
--
42+
43+
. Use the following configuration to specify how the PVCs are mounted in the container:
44+
+
45+
--
46+
.Example configuration for mounting PVCs in a container
47+
[source,yaml]
48+
----
49+
spec:
50+
application:
51+
extraFiles:
52+
mountPath: /my/path
53+
pvcs:
54+
- name: myclaim1
55+
- name: myclaim2
56+
mountPath: /vol/my/claim
57+
----
58+
--
59+
60+
.Verification
61+
Based on the configuration, the following directories are mounted in the container:
62+
63+
* `/my/path/myclaim1`
64+
* `/vol/my/claim`
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
[id="proc-mount-secrets-pvcs-specific-containers_{context}"]
3+
= Mounting Secrets and PVCs to specific containers
4+
5+
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.
6+
7+
.Procedure
8+
9+
. To mount Secrets to *all* containers, set the `rhdh.redhat.com/containers` annotation to `*`:
10+
+
11+
.Example mounting to all containers
12+
[source,yaml,subs="+attributes,+quotes"]
13+
----
14+
apiVersion: v1
15+
kind: Secret
16+
metadata:
17+
name: _<my_secret>_
18+
annotations:
19+
rhdh.redhat.com/containers: `*`
20+
----
21+
+
22+
[IMPORTANT]
23+
====
24+
Set `rhdh.redhat.com/containers` to `*` to mount it to all containers in the deployment.
25+
====
26+
27+
. To mount to specific containers, separate the names with commas:
28+
+
29+
.Example separating the list of containers
30+
[source,yaml,subs="+attributes,+quotes"]
31+
----
32+
apiVersion: v1
33+
kind: PersistentVolumeClaim
34+
metadata:
35+
name: myclaim
36+
annotations:
37+
rhdh.redhat.com/containers: "init-dynamic-plugins,backstage-backend"
38+
----
39+
+
40+
[NOTE]
41+
====
42+
This configuration mounts the `myclaim` PVC to the `init-dynamic-plugins` and `backstage-backend` containers.
43+
====

titles/configuring/master.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,8 @@ include::modules/installation/proc-configuring-an-rhdh-instance-with-tls-in-kube
3333
include::modules/dynamic-plugins/con-dynamic-plugins-cache.adoc[ leveloffset=+1]
3434

3535

36+
include::assemblies/assembly-configuring-default-secret-pvc-mounts.adoc[leveloffset=+1]
37+
38+
3639
include::modules/dynamic-plugins/proc-installing-and-configuring-redis-cache.adoc[leveloffset=+1]
3740

0 commit comments

Comments
 (0)