From 1d3150755258ddfd9ad7e90df1ace2ccac979a8d Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 9 Apr 2025 16:41:04 +0200 Subject: [PATCH 1/4] Default pvc and secret config --- ...configuring-default-secret-pvc-mounts.adoc | 9 +++ .../proc-configuring-mount-paths.adoc | 64 +++++++++++++++++++ .../proc-mounting-to-specific-containers.adoc | 43 +++++++++++++ titles/configuring/master.adoc | 3 + 4 files changed, 119 insertions(+) create mode 100644 assemblies/assembly-configuring-default-secret-pvc-mounts.adoc create mode 100644 modules/configuring-external-databases/proc-configuring-mount-paths.adoc create mode 100644 modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc 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..42439c19eb --- /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 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. + +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..59724bbd50 --- /dev/null +++ b/modules/configuring-external-databases/proc-configuring-mount-paths.adoc @@ -0,0 +1,64 @@ +[id="proc-mount-directories-pvcs_{context}"] += Mounting directories from pre-created PVCs + +Starting from `v1alpha3`, you can mount directories from pre-created PersistentVolumeClaims (PVCs) using the `spec.application.extraFiles.pvcs` field. + +.Prerequisites +* You have understanding of the mounting logic: +** If `spec.application.extraFiles.pvcs[].mountPath` is defined, the PVC is mounted to the specified path. +** If `spec.application.extraFiles.pvcs[].mountPath` is not defined, the PVC is mounted under the path specified in `spec.application.extraFiles.mountPath/`. +** 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. + +.Procedure +. Define the PVCs using the following YAML example: ++ +-- +.Example YAML file to define PVCs +[source,yaml] +---- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: myclaim1 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: myclaim2 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi +---- +-- + +. Use the following configuration to specify how the PVCs are mounted in the container: ++ +-- +.Example configuration for mounting PVCs in a container +[source,yaml] +---- +spec: + application: + extraFiles: + mountPath: /my/path + pvcs: + - name: myclaim1 + - name: myclaim2 + mountPath: /vol/my/claim +---- +-- + +.Verification +Based on the configuration, the following directories are mounted in the container: + +* `/my/path/myclaim1` +* `/vol/my/claim` 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..f8e957f9e8 --- /dev/null +++ b/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc @@ -0,0 +1,43 @@ +:_mod-docs-content-type: PROCEDURE +[id="proc-mount-secrets-pvcs-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 `*`: ++ +.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: myclaim + annotations: + rhdh.redhat.com/containers: "init-dynamic-plugins,backstage-backend" +---- ++ +[NOTE] +==== +This configuration mounts the `myclaim` 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] From 23ca92b614f538bd6dfff830b13bffb5b61d9111 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 10 Apr 2025 10:37:38 +0200 Subject: [PATCH 2/4] Default pvc and secret config --- .../proc-configuring-mount-paths.adoc | 82 +++++++------------ 1 file changed, 30 insertions(+), 52 deletions(-) diff --git a/modules/configuring-external-databases/proc-configuring-mount-paths.adoc b/modules/configuring-external-databases/proc-configuring-mount-paths.adoc index 59724bbd50..a8ec412ef7 100644 --- a/modules/configuring-external-databases/proc-configuring-mount-paths.adoc +++ b/modules/configuring-external-databases/proc-configuring-mount-paths.adoc @@ -1,64 +1,42 @@ -[id="proc-mount-directories-pvcs_{context}"] -= Mounting directories from pre-created PVCs +:_mod-docs-content-type: PROCEDURE +[id="proc-configure-mount-path-secrets-pvcs_{context}"] += Configuring mount paths for Secrets and PVCs -Starting from `v1alpha3`, you can mount directories from pre-created PersistentVolumeClaims (PVCs) using the `spec.application.extraFiles.pvcs` field. +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`. -.Prerequisites -* You have understanding of the mounting logic: -** If `spec.application.extraFiles.pvcs[].mountPath` is defined, the PVC is mounted to the specified path. -** If `spec.application.extraFiles.pvcs[].mountPath` is not defined, the PVC is mounted under the path specified in `spec.application.extraFiles.mountPath/`. -** 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. +You can add the `rhdh.redhat.com/mount-path` annotation to specify a custom path. .Procedure -. Define the PVCs using the following YAML example: + +. 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 YAML file to define PVCs -[source,yaml] +.Example specifying where the PVC mounts +[source,yaml,subs="+attributes,+quotes"] ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: myclaim1 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: myclaim2 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi +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. -. Use the following configuration to specify how the PVCs are mounted in the container: +. 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 configuration for mounting PVCs in a container -[source,yaml] +.Example specifying where the Secret mounts +[source,yaml,subs="+attributes,+quotes"] ---- -spec: - application: - extraFiles: - mountPath: /my/path - pvcs: - - name: myclaim1 - - name: myclaim2 - mountPath: /vol/my/claim +apiVersion: v1 +kind: Secret +metadata: + name: __ + annotations: + rhdh.redhat.com/mount-path: /mount/path/from/annotation ---- --- - -.Verification -Based on the configuration, the following directories are mounted in the container: +where: -* `/my/path/myclaim1` -* `/vol/my/claim` +:: Specifies the Secret name. \ No newline at end of file From 1914f3d0734d3697eed215fddc3ac06fb11a259f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 10 Apr 2025 10:44:38 +0200 Subject: [PATCH 3/4] Default pvc and secret config --- .../proc-configuring-mount-paths.adoc | 2 +- .../proc-mounting-to-specific-containers.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/configuring-external-databases/proc-configuring-mount-paths.adoc b/modules/configuring-external-databases/proc-configuring-mount-paths.adoc index a8ec412ef7..6436473669 100644 --- a/modules/configuring-external-databases/proc-configuring-mount-paths.adoc +++ b/modules/configuring-external-databases/proc-configuring-mount-paths.adoc @@ -1,5 +1,5 @@ :_mod-docs-content-type: PROCEDURE -[id="proc-configure-mount-path-secrets-pvcs_{context}"] +[id="proc-configuring-mount-paths_{context}"] = Configuring mount paths for Secrets and PVCs 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`. diff --git a/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc b/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc index f8e957f9e8..765f3f1d68 100644 --- a/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc +++ b/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc @@ -1,5 +1,5 @@ :_mod-docs-content-type: PROCEDURE -[id="proc-mount-secrets-pvcs-specific-containers_{context}"] +[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. From beec84badc698d3c8e33ed4c093b5668b3d68f85 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 16 Apr 2025 13:41:59 +0200 Subject: [PATCH 4/4] Default pvc and secret config --- .../assembly-configuring-default-secret-pvc-mounts.adoc | 2 +- .../proc-configuring-mount-paths.adoc | 8 +++----- .../proc-mounting-to-specific-containers.adoc | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/assemblies/assembly-configuring-default-secret-pvc-mounts.adoc b/assemblies/assembly-configuring-default-secret-pvc-mounts.adoc index 42439c19eb..af8710113c 100644 --- a/assemblies/assembly-configuring-default-secret-pvc-mounts.adoc +++ b/assemblies/assembly-configuring-default-secret-pvc-mounts.adoc @@ -2,7 +2,7 @@ [id="assembly-configuring-default-secret-pvc-mounts_{context}"] = Configuring default mounts for Secrets and PVCs -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. +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] diff --git a/modules/configuring-external-databases/proc-configuring-mount-paths.adoc b/modules/configuring-external-databases/proc-configuring-mount-paths.adoc index 6436473669..42d9279d4b 100644 --- a/modules/configuring-external-databases/proc-configuring-mount-paths.adoc +++ b/modules/configuring-external-databases/proc-configuring-mount-paths.adoc @@ -2,9 +2,7 @@ [id="proc-configuring-mount-paths_{context}"] = Configuring mount paths for Secrets and PVCs -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`. - -You can add the `rhdh.redhat.com/mount-path` annotation to specify a custom path. +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 @@ -23,7 +21,7 @@ metadata: 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. +__:: 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: + @@ -39,4 +37,4 @@ metadata: ---- where: -:: Specifies the Secret name. \ No newline at end of file +__:: 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 index 765f3f1d68..b5f04c1b04 100644 --- a/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc +++ b/modules/configuring-external-databases/proc-mounting-to-specific-containers.adoc @@ -6,7 +6,7 @@ By default, Secrets and PVCs mount only to the {product} `backstage-backend` con .Procedure -. To mount Secrets to *all* containers, set the `rhdh.redhat.com/containers` annotation to `*`: +. 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"] @@ -32,12 +32,12 @@ Set `rhdh.redhat.com/containers` to `*` to mount it to all containers in the dep apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: myclaim + name: __ annotations: rhdh.redhat.com/containers: "init-dynamic-plugins,backstage-backend" ---- + [NOTE] ==== -This configuration mounts the `myclaim` PVC to the `init-dynamic-plugins` and `backstage-backend` containers. +This configuration mounts the `__` PVC to the `init-dynamic-plugins` and `backstage-backend` containers. ==== \ No newline at end of file