|
| 1 | +:_mod-docs-content-type: PROCEDURE |
| 2 | +[id="proc-default-configuration-for-secrets-and-pvcs_{context}"] |
| 3 | += Configuring default configuration for Secrets and PVCs |
| 4 | + |
| 5 | +By default, the mount path is the {product-short} container's working directory, and if you do not define the mount path, it defaults to `/opt/app-root/src`. The default configuration files are `secret-files` and PVCs. You can add the `rhdh.redhat.com/mount-path` annotation to your configuration file to specify the mount path. |
| 6 | + |
| 7 | +.Procedure |
| 8 | + |
| 9 | +. Specify the mount path where the PVC mounts to by adding the `rhdh.redhat.com/mount-path` annotation to your configuration as shown in the following example: |
| 10 | ++ |
| 11 | +.Example specifying where the PVC mounts |
| 12 | +[source,yaml,subs="+attributes,+quotes"] |
| 13 | +---- |
| 14 | +apiVersion: v1 |
| 15 | +kind: PersistentVolumeClaim |
| 16 | +metadata: |
| 17 | + name: _<my_claim>_ |
| 18 | + annotations: |
| 19 | + rhdh.redhat.com/mount-path: /mount/path/from/annotation |
| 20 | +---- |
| 21 | +where: |
| 22 | + |
| 23 | +`rhdh.redhat.com/mount-path`:: Specifies which mount path the PVC mounts to (in this case, `/mount/path/from/annotation` directory). |
| 24 | +<my_claim>:: Specifies the PVC to mount. |
| 25 | + |
| 26 | +. Specify the mount path where the Secret mounts to by adding the `rhdh.redhat.com/mount-path` annotation to your configuration as shown in the following example: |
| 27 | ++ |
| 28 | +.Example specifying where the Secret mounts |
| 29 | +[source,yaml,subs="+attributes,+quotes"] |
| 30 | +---- |
| 31 | +apiVersion: v1 |
| 32 | +kind: Secret |
| 33 | +metadata: |
| 34 | + name: _<my_secret>_ |
| 35 | + annotations: |
| 36 | + rhdh.redhat.com/mount-path: /mount/path/from/annotation |
| 37 | +---- |
| 38 | +where: |
| 39 | + |
| 40 | +<my_secret>:: Specifies the Secret name. |
| 41 | + |
| 42 | +. Use the following configuration to mount Secrets to all containers: |
| 43 | ++ |
| 44 | +.Example configuration for mounting to all containers |
| 45 | +[source,yaml,subs="+attributes,+quotes"] |
| 46 | +---- |
| 47 | +apiVersion: v1 |
| 48 | +kind: Secret |
| 49 | +metadata: |
| 50 | + name: _<my_secret>_ |
| 51 | + annotations: |
| 52 | + rhdh.redhat.com/containers: `*` |
| 53 | +---- |
| 54 | ++ |
| 55 | +[IMPORTANT] |
| 56 | +==== |
| 57 | +Set `rhdh.redhat.com/containers` to `*` to mount it to all containers in the deployment. |
| 58 | +==== |
| 59 | + |
| 60 | +. Optional: Use commas to separate the list of containers (for example, `init-dynamic-plugins` and `,backstage-backend`) where the files mount to as shown in the following example: |
| 61 | ++ |
| 62 | +.Example configuration for separating the list of containers |
| 63 | +[source,yaml,subs="+attributes,+quotes"] |
| 64 | +---- |
| 65 | +apiVersion: v1 |
| 66 | +kind: PersistentVolumeClaim |
| 67 | +metadata: |
| 68 | + name: myclaim |
| 69 | + annotations: |
| 70 | + rhdh.redhat.com/containers: "init-dynamic-plugins,backstage-backend" |
| 71 | +---- |
0 commit comments