Skip to content

Commit 952e6c7

Browse files
RHIDP-4780: Document per-ConfigMap/Secret configuration of mountPath (#842)
* Content added * Fixing indentation error * Incorporated comments * Incorporated comments * Incorporated comments * Update ref-release-notes-new-features.adoc --------- Co-authored-by: Gerry-Forde <[email protected]>
1 parent 739dcfd commit 952e6c7

File tree

4 files changed

+95
-17
lines changed

4 files changed

+95
-17
lines changed

artifacts/attributes.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
:my-product-database-certificates-secrets: my-rhdh-database-certificates-secrets
2929
:my-product-database-secrets: my-rhdh-database-secrets
3030
:my-product-url: https://__<my_developer_hub_url>__
31+
:my-extra-file-configmap: my-project-configmap
3132

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

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: 77 additions & 0 deletions
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

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This section highlights new features in {product} {product-version}.
77
[id="enhancement-rhidp-2200"]
88
== Added an individual `mountPath`
99

10-
This update adds an additional individual `mountPath` for extra configmaps or secrets.
10+
This update adds an individual `mountPath` for link:{configuring-book-url}#proc-mounting-additional-files-in-your-custom-configuration-using-rhdh-operator[extra ConfigMaps or Secrets].
1111

1212
[id="feature-rhidp-3621"]
1313
== `PersistentVolumeClaims` support is available
@@ -27,25 +27,24 @@ This update removes the `kube-rbac-proxy` sidecar container from the RHDH Operat
2727
[id="feature-rhidp-4414"]
2828
== Identifying Backstage flavor for plugins by using the `developerHub.flavor` field
2929

30-
With this update, you can use the `developerHub.flavor` field to identify whether plugins are running on {product-very-short}, {rhtap-very-short}, or vanilla Backstage, as shown in the following example:
31-
32-
.`app-config.yaml` fragment with the `developerhub.flavor` field
33-
34-
[source,yaml,subs=&#34;quotes&#34;]
35-
----
36-
developerHub:
37-
flavor: &lt;flavor&gt;;
38-
----
39-
40-
`flavor`::
41-
Identify the flavor of Backstage that is running. Default value: `rhdh`
30+
With this update, you can use the `developerHub.flavor` field to identify whether plugins are running on {product-very-short}, {rhtap-very-short}, or vanilla Backstage, as shown in the following example:
31+
32+
.`app-config.yaml` fragment with the `developerhub.flavor` field
33+
34+
[source,yaml,subs="+quotes"]
35+
----
36+
developerHub:
37+
flavor: &lt;flavor&gt;;
38+
----
39+
40+
`flavor`::
41+
Identify the flavor of Backstage that is running. Default value: `rhdh`
4242

4343

4444
[id="feature-rhidp-4419"]
4545
== Ability to manage PVCs in RHDH Operator
4646

47-
You can now mount directories from pre-created PersistentVolumeClaims (PVCs) using the `spec.application.extraFiles.pvcs` field, while configuring RHDH Operator.
48-
For more information, see link:https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.4/html-single/configuring/index#configuring-the-deployment[Persistent Volume Claim (PVC)].
47+
You can now mount directories from pre-created PersistentVolumeClaims (PVCs) using the `spec.application.extraFiles.pvcs` field, while configuring {product-very-short} Operator.
4948

5049

5150
[id="feature-rhidp-4805"]
@@ -56,8 +55,8 @@ With this update, you can use {rhbk-brand-name} as an authentication provider. T
5655
[id="feature-rhidp-4806"]
5756
== Ability to install third-party plugins in RHDH
5857

59-
You can now install third-party plugins in {product} without rebuilding the {product-very-short} application.
60-
58+
You can now install third-party plugins in {product} without rebuilding the {product-very-short} application.
59+
6160
For more information, see link:https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.4/html-single/introduction_to_plugins/index[Third party plugins].
6261

6362
[id="feature-rhidp-5156"]

0 commit comments

Comments
 (0)