Skip to content

Commit 1b83c47

Browse files
committed
More changes
1 parent 3eb1089 commit 1b83c47

File tree

4 files changed

+49
-71
lines changed

4 files changed

+49
-71
lines changed

modules/configuring/con-mounting-and-container-targeting-details.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ The mounting behavior is determined by the combination of the optional `key` and
4040

4141
[NOTE]
4242
====
43-
To limit read access to Secrets by the Operator Service Account, you must specify both `mountPath` and `key` when mounting files from Secrets.
43+
For security reasons, mounting files from **Secrets** is not supported if both `mountPath` and `key` are unspecified.
4444
====

modules/configuring/proc-injecting-custom-files-and-environment-variables-into-backstage-containers.adoc

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,51 @@
66

77
You must use the `spec.application` path to configure the injection of custom files and environment variables into your {backstage} Pod containers. This ensures necessary configurations, credentials, and dependencies (such as certificates) are available at runtime.
88

9-
By default, resources inject into the **`backstage-backend`** container. You can also specify other targets, including a list of containers by name (such as `dynamic-plugin-install` or custom sidecars) or opt to in all containers in the {backstage} Pod.
10-
11-
.Procedure
12-
. To configure resource injection, use the following fields under `spec.application`:
13-
14-
.. File Injection (`spec.application.extraFiles`): Define external file resources to be mounted as volumes from pre-created ConfigMaps, Secrets, or PVCs.
15-
** **File Sources:**
16-
*** `configMaps`:: Sources file volumes from Kubernetes ConfigMaps.
17-
*** `secrets`:: Sources file volumes from Kubernetes Secrets.
18-
*** `pvcs`:: Sources volume claims from Kubernetes Persistent Volume Claims (PVCs).
19-
20-
.. Environment Variable Injection (`spec.application.extraEnvs`): Define the environment variables to be injected into the targeted containers.
21-
** **Environment Sources:**
22-
*** `configMaps`:: Injects environment variables sourced from Kubernetes ConfigMaps.
23-
*** `secrets`:: Injects environment variables sourced from Kubernetes Secrets.
24-
*** `envs`:: Injects hardcoded environment variables defined directly in the manifest.
9+
You can mount extra files, sourced from pre-created Kubernetes ConfigMaps or Secrets, to your {backstage} Pod containers using the `spec.application.extraFiles` path.
10+
11+
By default, files mount only to the `backstage-backend` container. You can also specify other targets, including a list of containers by name (such as `dynamic-plugin-install` or custom sidecars) or opt to in all containers in the {backstage} Pod.
12+
13+
. To mount extra files, apply the configuration to your `{product-custom-resource-type} custom resource (CR)` as shown in the following code:
14+
+
15+
[source,yaml]
16+
----
17+
spec:
18+
application:
19+
extraFiles:
20+
mountPath: /my/path
21+
configMaps:
22+
- name: cm1
23+
- name: cm2
24+
key: file21.txt
25+
containers:
26+
- "*"
27+
- name: cm3
28+
mountPath: /my/cm3/path
29+
containers:
30+
- backstage-backend
31+
- install-dynamic-plugins
32+
secrets:
33+
- name: secret1
34+
key: file3.txt
35+
containers:
36+
- install-dynamic-plugins
37+
- name: secret2
38+
mountPath: /my/secret2/path
39+
----
40+
41+
If the `containers` field is not specified, the volume mounts to the `backstage-backend` container only. The following explicit options are supported:
42+
43+
* No or empty field: Mounts only to the `backstage-backend` container.
44+
* `*` (asterisk) as the first and only array element: Mounts to all containers.
45+
* Explicit container names (for example, `install-dynamic-plugins`): Mounts only to the listed containers.
46+
47+
.Verification
48+
49+
The files are mounted with the following paths and container targets:
50+
51+
* `/my/path/file11.txt`: Mounted to `backstage-backend` container only.
52+
* `/my/path/file12.txt`: Mounted to `backstage-backend` container only.
53+
* `/my/path/file21.txt`: Mounted to all containers.
54+
* `/my/secret1/path/file3.txt`: Mounted to `install-dynamic-plugins` container only.
55+
* `/my/cm3/path/`: Directory mounted to `backstage-backend` and `install-dynamic-plugins` containers.
56+
* `/my/secret2/path/`: Directory mounted to `backstage-backend` container only.

modules/configuring/ref-extra-files-configuration-example.adoc

Lines changed: 0 additions & 52 deletions
This file was deleted.

titles/configuring/master.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ include::modules/configuring/proc-injecting-custom-files-and-environment-variabl
3232

3333
include::modules/configuring/con-mounting-and-container-targeting-details.adoc[leveloffset=+2]
3434

35-
include::modules/configuring/ref-extra-files-configuration-example.adoc[leveloffset=+2]
36-
3735
include::assemblies/assembly-configuring-high-availability.adoc[leveloffset=+1]
3836

3937

0 commit comments

Comments
 (0)