Skip to content

Commit 9e97a36

Browse files
authored
RHIDP-5901: readOnlyRootFilesystem option (redhat-developer#938)
* Added content * Minor changes * Incorporated Armel's comments * Incorporated Lindsey's comment * added to master * Minor comment * Added bullet points
1 parent 59c965a commit 9e97a36

6 files changed

+59
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
:context: readonlyrootfilesystem
3+
[id="{context}"]
4+
= Configuring readOnlyRootFilesystem in {product}
5+
6+
The {product} deployment consists of two containers: an `initContainer` that installs the Dynamic Plugins, and a backend container that runs the application. The `initContainer` has the `readOnlyRootFilesystem` option enabled by default. To enable this option on the backend container, you must either have permission to deploy resources through Helm or to create or update a CR for Operator-backed deployments. You can manually configure the `readOnlyRootFilesystem` option on the backend container by using the following methods:
7+
8+
* The {product} Operator
9+
* The {product} Helm chart
10+
11+
include::modules/configuring-readonlyrootfilesystem/proc-configuring-readonlyrootfilesystem-option-in-rhdh-operator-deployment.adoc[leveloffset=+1]
12+
13+
include::modules/configuring-readonlyrootfilesystem/proc-configuring-readonlyrootfilesystem-option-in-rhdh-helm-chart-deployment.adoc[leveloffset=+1]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[id="proc-configuring-readonlyrootfilesystem-option-in-rhdh-helm-chart-deployment"]
2+
= Configuring the readOnlyRootFilesystem option in a {product} Helm chart deployment
3+
4+
.Procedure
5+
. In your 'values.yaml' file, add the `readOnlyRootFilesystem: true` line to the `containerSecurityContext` section. For example:
6+
+
7+
====
8+
[source,yaml,subs="+attributes,+quotes"]
9+
----
10+
upstream:
11+
backstage:
12+
containerSecurityContext:
13+
readOnlyRootFilesystem: true
14+
----
15+
====
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[id="proc-configuring-readonlyrootfilesystem-option-in-rhdh-operator-deployment"]
2+
= Configuring the readOnlyRootFilesystem option in a {product} Operator deployment
3+
4+
When you are deploying {product-short} using the Operator, you must specify a `patch` for the `deployment` in your `{product-custom-resource-type}` custom resource (CR) that applies the `readOnlyRootFilesystem` option to the `securityContext` section in the {product-short} backend container.
5+
6+
.Procedure
7+
8+
. In your `{product-custom-resource-type}` CR, add the `securityContext` specification. For example:
9+
+
10+
====
11+
[source,yaml,subs="+attributes,+quotes"]
12+
----
13+
spec:
14+
deployment:
15+
patch:
16+
spec:
17+
template:
18+
spec:
19+
containers:
20+
- name: backstage-backend <1>
21+
securityContext:
22+
readOnlyRootFilesystem: true
23+
----
24+
====
25+
<1> Name of the main container defined in the Operator default configuration.

modules/configuring/proc-mounting-additional-files-in-your-custom-configuration-using-rhdh-operator.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The `mountPath` field specifies the location where a ConfigMap or Secret is moun
1111

1212
[NOTE]
1313
====
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.
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.
1515
* 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.
1616
====
1717

modules/configuring/proc-using-the-operator-to-run-rhdh-with-your-custom-configuration.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[id="using-the-operator-to-run-rhdh-with-your-custom-configuration"]
2-
= Using the {product} operator to run {product-short} with your custom configuration
2+
= Using the {product} Operator to run {product-short} with your custom configuration
33

4-
To use the {product-short} operator to run {product} with your custom configuration, create your {product-custom-resource-type} custom resource (CR) that:
4+
To use the {product-short} Operator to run {product} with your custom configuration, create your {product-custom-resource-type} custom resource (CR) that:
55

66
* Mounts files provisioned in your custom config maps.
77
* Injects environment variables provisioned in your custom secrets.

titles/configuring/master.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ include::assemblies/assembly-configuring-external-postgresql-databases.adoc[leve
1818
include::modules/configuring-deployment/proc-configuring-deployment-by-using-the-operator.adoc[leveloffset=+1]
1919

2020

21+
include::assemblies/assembly-configuring-readonlyrootfilesystem.adoc[leveloffset=+1]
22+
23+
2124
include::assemblies/assembly-configuring-a-proxy.adoc[leveloffset=+1]
2225

2326

0 commit comments

Comments
 (0)