Skip to content

Commit 5da93da

Browse files
committed
Content added
1 parent 33446a6 commit 5da93da

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

assemblies/assembly-provisioning-a-custom-configuration.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ include::modules/configuring/proc-provisioning-your-custom-configuration.adoc[le
2222

2323
include::modules/configuring/proc-using-the-operator-to-run-rhdh-with-your-custom-configuration.adoc[leveloffset=+1]
2424

25+
include::modules/configuring/proc-mounting-additional-files-in-your-custom-configuration-using-rhdh-operator.adoc[][leveloffset=+2]
2526

2627
include::modules/configuring/proc-using-the-helm-chart-to-run-rhdh-with-your-custom-configuration.adoc[leveloffset=+1]
2728

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[id="mounting-additional-files-in-your-custom-configuration-using-rhdh-operator"]
2+
= Mounting additional files in your custom configuration using the {product} operator
3+
4+
You can use the {product-short} operator to mount extra files, such as ConfigMaps and Secrets, to the container in a preferred location.
5+
6+
The `mountPath` field specifies the location where a ConfigMap or Secret is mounted. The behavior of the mount, whether it includes or excludes a `subPath`, depends on the specification of the `key` or `mountPath` fields.
7+
8+
* If `key` and `mountPath` are not specified: Each key or value is mounted as a `filename` or content with a `subPath`.
9+
* If `key` is specified with or without `mountPath`: The specified key or value is mounted with a `subPath`.
10+
* If only `mountPath` is specified: A directory containing all the keys or values is mounted without a `subPath`.
11+
12+
[NOTE]
13+
====
14+
* {ocp-short} does not automatically update a volume mounted with subPath. By default, the {product-very-short} operator monitors these Config Maps or Secrets and refreshes the {product-very-short} Pod when changes occur.
15+
* For security purposes, {product} restricts the Operator Service Account's read access to Secrets. As a result, mounting files from Secrets without specifying both mountPath and key is not supported.
16+
====
17+
18+
19+
.Prerequisites
20+
* You have developer permissions to access the {ocp-short} cluster containing your {product-short} instance using the {openshift-cli}.
21+
* link:{installing-on-ocp-book-url}[Your {ocp-short} administrator has installed the {product} Operator in {ocp-short}].
22+
23+
.Procedure
24+
25+
. In {ocp-short}, author your ConfigMap or Secret custom resource in a YAML file. For more information, see link:{installing-on-ocp-book-url}#provisioning-your-custom-configuration[].
26+
+
27+
.Minimal `{my-app-config-config-map}` custom resource example
28+
====
29+
[source,yaml,subs="+attributes,+quotes"]
30+
----
31+
apiVersion: v1
32+
kind: ConfigMap
33+
metadata:
34+
name: {my-product-cr-name}
35+
data:
36+
file11.txt: |
37+
My file11 content
38+
file 12.txt: |
39+
My file12 content
40+
----
41+
====
42+
+
43+
.Minimal `{my-product-secrets}` custom resource example
44+
====
45+
[source,yaml,subs="+attributes,+quotes"]
46+
----
47+
apiVersion: v1
48+
kind: Secret
49+
metadata:
50+
name: {my-product-secrets}
51+
StringData:
52+
secret11.txt: |
53+
secret-content
54+
----
55+
====
56+
57+
. Declare the ConfigMap or Secret file in your `{product-custom-resource-type}` custom resource.
58+
====
59+
[source,yaml,subs="+attributes,+quotes"]
60+
----
61+
spec:
62+
application:
63+
extraFiles:
64+
mountPath: /my/path
65+
configMaps:
66+
- name: {my-app-config-config-map}
67+
key: file12.txt
68+
mountPath: /my/my-rhdh-config-map/path
69+
secrets:
70+
- name: my-rhdh-secret
71+
key: secret11.txt
72+
mountPath: /my/my-rhdh-secret/path
73+
74+
----
75+
====

0 commit comments

Comments
 (0)