Skip to content

Commit 4293411

Browse files
Manual CP for PR-842 to Main (redhat-developer#870)
* Content added * Fixing indentation error * Incorporated comments * Fixed merge conflict * Incorporated comments * Update ref-release-notes-new-features.adoc * Fixed merge conflicts * Fixed capitalization --------- Co-authored-by: Gerry-Forde <[email protected]>
1 parent b7c0349 commit 4293411

4 files changed

+79
-1
lines changed

artifacts/attributes.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
:my-product-database-certificates-secrets: my-rhdh-database-certificates-secrets
2828
:my-product-database-secrets: my-rhdh-database-secrets
2929
:my-product-url: https://__<my_developer_hub_url>__
30+
:my-extra-file-configmap: my-project-configmap
3031

3132
// Red Hat Platforms
3233
:ocp-brand-name: Red Hat OpenShift Container Platform

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

+1
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

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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 a ConfigMap or Secret, 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 ConfigMaps or Secrets and refreshes the {product-very-short} Pod when changes occur.
15+
* For security purposes, {product} does not give the Operator Service Account 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}, create your ConfigMap or Secret with the following YAML codes:
26+
+
27+
.Minimal `{my-extra-file-configmap}` ConfigMap example
28+
====
29+
[source,yaml,subs="+attributes,+quotes"]
30+
----
31+
apiVersion: v1
32+
kind: ConfigMap
33+
metadata:
34+
name: {my-extra-file-configmap}
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}` Secret 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+
For more information, see xref:provisioning-your-custom-configuration[Provisioning and using your custom {product} configuration].
57+
58+
. Set the value of the `configMaps name` to the name of the ConfigMap or `secrets name` to the name of the Secret in your `{product-custom-resource-type}` CR. For example:
59+
+
60+
====
61+
[source,yaml,subs="+attributes,+quotes"]
62+
----
63+
spec:
64+
application:
65+
extraFiles:
66+
mountPath: /my/path
67+
configMaps:
68+
- name: {my-extra-file-configmap}
69+
key: file12.txt
70+
mountPath: /my/my-rhdh-config-map/path
71+
secrets:
72+
- name: {my-product-secrets}
73+
key: secret11.txt
74+
mountPath: /my/my-rhdh-secret/path
75+
76+
----
77+
====

modules/release-notes/ref-release-notes-new-features.adoc

-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44

55
This section highlights new features in {product} {product-version}.
66

7-
87
None.
98

0 commit comments

Comments
 (0)