Skip to content

Commit 8597a23

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

File tree

1 file changed

+30
-52
lines changed

1 file changed

+30
-52
lines changed
Lines changed: 30 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,42 @@
1-
[id="proc-mount-directories-pvcs_{context}"]
2-
= Mounting directories from pre-created PVCs
1+
:_mod-docs-content-type: PROCEDURE
2+
[id="proc-configure-mount-path-secrets-pvcs_{context}"]
3+
= Configuring mount paths for Secrets and PVCs
34

4-
Starting from `v1alpha3`, you can mount directories from pre-created PersistentVolumeClaims (PVCs) using the `spec.application.extraFiles.pvcs` field.
5+
By default, the mount path is the {product-short} container's working directory. If you do not define the mount path, it defaults to `/opt/app-root/src`.
56

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.
7+
You can add the `rhdh.redhat.com/mount-path` annotation to specify a custom path.
118

129
.Procedure
13-
. Define the PVCs using the following YAML example:
10+
11+
. To specify a PVC mount path, add the `rhdh.redhat.com/mount-path` annotation to your configuration file as shown in the following example:
1412
+
15-
--
16-
.Example YAML file to define PVCs
17-
[source,yaml]
13+
.Example specifying where the PVC mounts
14+
[source,yaml,subs="+attributes,+quotes"]
1815
----
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
16+
apiVersion: v1
17+
kind: PersistentVolumeClaim
18+
metadata:
19+
name: _<my_claim>_
20+
annotations:
21+
rhdh.redhat.com/mount-path: /mount/path/from/annotation
4022
----
41-
--
23+
where:
24+
25+
`rhdh.redhat.com/mount-path`:: Specifies which mount path the PVC mounts to (in this case, `/mount/path/from/annotation` directory).
26+
<my_claim>:: Specifies the PVC to mount.
4227

43-
. Use the following configuration to specify how the PVCs are mounted in the container:
28+
. To specify a Secret mount path, add the `rhdh.redhat.com/mount-path` annotation to your configuration file as shown in the following example:
4429
+
45-
--
46-
.Example configuration for mounting PVCs in a container
47-
[source,yaml]
30+
.Example specifying where the Secret mounts
31+
[source,yaml,subs="+attributes,+quotes"]
4832
----
49-
spec:
50-
application:
51-
extraFiles:
52-
mountPath: /my/path
53-
pvcs:
54-
- name: myclaim1
55-
- name: myclaim2
56-
mountPath: /vol/my/claim
33+
apiVersion: v1
34+
kind: Secret
35+
metadata:
36+
name: _<my_secret>_
37+
annotations:
38+
rhdh.redhat.com/mount-path: /mount/path/from/annotation
5739
----
58-
--
59-
60-
.Verification
61-
Based on the configuration, the following directories are mounted in the container:
40+
where:
6241

63-
* `/my/path/myclaim1`
64-
* `/vol/my/claim`
42+
<my_secret>:: Specifies the Secret name.

0 commit comments

Comments
 (0)