Skip to content

Commit 3984733

Browse files
committed
RHIDP-7849 Added existing modules to the _Getting started with RHDH on OCP_ title
Fixed existing content to build while reused. Signed-off-by: Fabrice Flore-Thébault <[email protected]>
1 parent 3b434c0 commit 3984733

File tree

21 files changed

+511
-45
lines changed

21 files changed

+511
-45
lines changed

assemblies/assembly-configuring-a-proxy.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
:_mod-docs-content-type: ASSEMBLY
2+
:previouscontext: {context}
23
:context: running-behind-a-proxy
34

45
[id="{context}"]
@@ -22,3 +23,5 @@ include::modules/configuring-a-proxy/proc-configuring-proxy-in-operator-deployme
2223

2324
include::modules/configuring-a-proxy/proc-configuring-proxy-in-helm-deployment.adoc[leveloffset=+1]
2425

26+
:context: {previouscontext}
27+
!:previouscontext:

assemblies/assembly-configuring-external-postgresql-databases.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
:_mod-docs-content-type: ASSEMBLY
2+
:previouscontext: {context}
23
:context: configuring-external-postgresql-databases
34

45
[id="{context}"]
@@ -22,3 +23,5 @@ include::modules/configuring-external-databases/proc-configuring-postgresql-inst
2223

2324
include::modules/configuring-external-databases/proc-migrating-databases-to-an-external-server.adoc[leveloffset=+1]
2425

26+
:context: {previouscontext}
27+
!:previouscontext:

assemblies/assembly-configuring-high-availability.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
:_mod-docs-content-type: ASSEMBLY
2+
:previouscontext: {context}
23
:context: HighAvailability
34

45
[id="{context}"]
@@ -28,3 +29,6 @@ As an administrator, you can configure high availability by adjusting replica va
2829
include::modules/configuring-high-availability/proc-configuring-high-availability-in-rhdh-operator-deployment.adoc[leveloffset=+1]
2930

3031
include::modules/configuring-high-availability/proc-configuring-high-availability-in-rhdh-helm-chart-deployment.adoc[leveloffset=+1]
32+
33+
:context: {previouscontext}
34+
!:previouscontext:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
:previouscontext: {context}
3+
:context: readonlyrootfilesystem
4+
[id="{context}"]
5+
= Configuring readOnlyRootFilesystem in {product}
6+
7+
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:
8+
9+
* The {product} Operator
10+
* The {product} Helm chart
11+
12+
include::modules/configuring-readonlyrootfilesystem/proc-configuring-readonlyrootfilesystem-option-in-rhdh-operator-deployment.adoc[leveloffset=+1]
13+
14+
include::modules/configuring-readonlyrootfilesystem/proc-configuring-readonlyrootfilesystem-option-in-rhdh-helm-chart-deployment.adoc[leveloffset=+1]
15+
16+
:context: {previouscontext}
17+
!:previouscontext:

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
:_mod-docs-content-type: ASSEMBLY
2+
:previouscontext: {context}
23
:context: provisioning-and-using-your-custom-configuration
34

45
[id="{context}"]
@@ -27,3 +28,5 @@ include::modules/configuring/proc-mounting-additional-files-in-your-custom-confi
2728

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

31+
:context: {previouscontext}
32+
!:previouscontext:
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:_mod-docs-content-type: CONCEPT
2+
3+
[id="checklist-to-run-your-first-rhdh-instance-in-production_{context}"]
4+
= Checklist to run your first {product} ({product-very-short}) instance in production.
5+
6+
With the default configuration, {product-short} runs with a minimal feature set that does not require to securely connect to external services such as an identity provider, a Git provider, and external PostgreSQL and Redis databases.
7+
8+
Therefore using critical features require configuration:
9+
10+
For resiliency::
11+
* Use an external PostgreSQL database.
12+
* Enable high-availability.
13+
14+
For performance::
15+
* Enable assets caching to an external Redis database.
16+
17+
For security::
18+
* Use secure connections to your external services.
19+
* Provision users and enable authentication.
20+
* Enable role-based access control, and configure the permission policy by using the Web UI.
21+
22+
To adapt to your environment::
23+
* Enable GitHub repository discovery.
24+
* Customize {product-short} appearance with your logo.

modules/installation/proc-configuring-an-rhdh-instance-with-tls-in-kubernetes.adoc renamed to modules/configuring/proc-configuring-an-rhdh-instance-with-tls-in-kubernetes.adoc

File renamed without changes.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="preparing-your-external-services"]
4+
= Preparing your external services
5+
6+
{product} relies on external services.
7+
Prepare the required external services.
8+
9+
PostgreSQL database::
10+
{product-short} stores data in a PostgreSQL database.
11+
For resiliency, use an external database and include it in your disaster recovery plan.
12+
13+
Redis cache::
14+
For efficiency, {product-short} caches plugin and Techdocs assets when your provide a Redis cache server.
15+
16+
GitHub API access::
17+
Provide credentials to a GitHub app to enable access to the GitHub API for repository discovery.
18+
19+
Connection to your identity provider::
20+
Provide credentials to your identity provider to enable user provisioning and authentication.
21+
22+
.Procedure
23+
* Get your external PostgreSQL database connection strings and certificates.
24+
postgres-host::: Your PostgreSQL instance Domain Name System (DNS) or IP address.
25+
postgres-port::: Your PostgreSQL instance port number, such as 5432.
26+
postres-username::: The user name to connect to your PostgreSQL instance.
27+
postgres-password::: The password to connect to your PostgreSQL instance.
28+
postgres-ca.pem:::
29+
postgres-key.key:::
30+
postgres-crt.pem:::
31+
For security, use TLS certificates to secure the connection to the database.
32+
33+
. Get your Redis cache server connection string, such as `rediss://user:[email protected]:6379`.
34+
For security, consider using a `rediss` secure server connection.
35+
36+
. To allow {product-short} to access the GitHub API for repository, create a GitHub App.
37+
Opt for a GitHub App instead of an OAuth app to use fine-grained permissions, gain more control over which repositories the application can access, and use short-lived tokens.
38+
39+
.. link:https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app[Register a GitHub App] with the following configuration:
40+
41+
GitHub App name::
42+
Enter a unique name identifying your GitHub App, such as `integrating-with-rhdh-__<GUID>__`.
43+
44+
Homepage URL::
45+
Enter your {product-short} URL: `pass:c,a,q[{my-product-url}]`.
46+
47+
Authorization callback URL::
48+
Enter your {product-short} authentication backend URL: `pass:c,a,q[{my-product-url}/api/auth/github/handler/frame]`.
49+
50+
Webhook::
51+
Clear "Active", as this is not needed for authentication and catalog providers.
52+
53+
App permissions::
54+
Select permissions to define the level of access for the app.
55+
Adapt permissions to your needs:
56+
57+
Reading software components:::
58+
59+
Contents::::
60+
`Read-only`
61+
62+
Commit statuses::::
63+
`Read-only`
64+
65+
Reading organization data:::
66+
67+
Members::::
68+
`Read-only`
69+
70+
Publishing software templates:::
71+
Set permissions if you intend to use the same GitHub App for software templates.
72+
73+
Administration::::
74+
`Read & write` (for creating repositories)
75+
76+
Contents::::
77+
`Read & write`
78+
79+
Metadata::::
80+
`Read-only`
81+
82+
Pull requests::::
83+
`Read & write`
84+
85+
Issues::::
86+
`Read & write`
87+
88+
Workflows::::
89+
`Read & write` (if templates include GitHub workflows)
90+
91+
Variables::::
92+
`Read & write` (if templates include GitHub Action Repository Variables)
93+
94+
Secrets::::
95+
`Read & write` (if templates include GitHub Action Repository Secrets)
96+
97+
Environments::::
98+
`Read & write` (if templates include GitHub Environments)
99+
100+
Organization permissions::
101+
Members:::
102+
`Read-only`
103+
104+
Where can this GitHub App be installed?::
105+
Select `Only on this account`.
106+
107+
.. In the *General* -> *Clients secrets* section, click *Generate a new client secret*.
108+
109+
.. In the *General* -> *Private keys* section, click *Generate a private key*.
110+
111+
.. In the *Install App* tab, choose an account to install your GitHub App on.
112+
113+
.. Save the following values for the next step:
114+
115+
* **App ID**
116+
* **Client ID**
117+
* **Client secret**
118+
* **Private key**

modules/configuring/proc-provisioning-your-custom-configuration.adoc

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,42 @@ Your changes on this configuration might get reverted on {product-short} restart
1414
.Prerequisites
1515
* By using the {platform-cli-link}, you have access, with developer permissions, to the {platform-generic} cluster aimed at containing your {product-short} instance.
1616

17+
include::snip-provisioning-your-custom-configuration-prerequisites-in-{context}-context.adoc[]
18+
1719
.Procedure
18-
. Author your custom `_<my_product_secrets>_.txt` file to provision your secrets as environment variables values in {a-platform-generic} secret,
20+
. For security, store your secrets as environment variables values in an {ocp-short} secret,
1921
rather than in clear text in your configuration files.
20-
It contains one secret per line in `KEY=value` form.
22+
Collect all your secrets in the `secrets.txt` file, with one secret per line in `KEY=value` form.
2123
+
22-
* {authentication-book-link}[Enter your authentication secrets].
24+
--
25+
include::snip-provisioning-your-custom-configuration-secrets-step-in-{context}-context.adoc[]
26+
--
2327

2428
. Author your custom `{my-app-config-file}` file.
2529
This is the main {product-short} configuration file.
2630
You need a custom `{my-app-config-file}` file to avoid the {product-short} installer to revert user edits during upgrades.
2731
When your custom `{my-app-config-file}` file is empty, {product-short} is using default values.
32+
+
33+
--
34+
include::snip-provisioning-your-custom-configuration-appconfig-step-in-{context}-context.adoc[]
35+
--
2836

29-
** To prepare a deployment with the {product} Operator on {platform}, you can start with an empty file.
30-
31-
** To prepare a deployment with the {product} Helm chart, or on Kubernetes, enter the {product-short} base URL in the relevant fields in your `{my-app-config-file}` file to ensure proper functionality of {product-short}.
32-
The base URL is what a {product-short} user sees in their browser when accessing {product-short}.
33-
The relevant fields are `baseUrl` in the `app` and `backend` sections, and `origin` in the `backend.cors` subsection:
37+
. Author your custom `dynamic-plugins.yaml` file to enable plugins.
38+
By default, {product-short} enables a minimal plugin set, and disables plugins that require configuration or secrets, such as the GitHub repository discovery plugin and the Role-based access control (RBAC) plugin.
3439
+
35-
.Configuring the `baseUrl` in `{my-app-config-file}`
36-
====
37-
[source,yaml,subs="+attributes,+quotes"]
40+
Enable the GitHub repository discovery and the RBAC features:
41+
+
42+
.`dynamic.plugins.yaml`
43+
[source,yaml]
3844
----
39-
app:
40-
title: {product}
41-
baseUrl: {my-product-url}
42-
43-
backend:
44-
auth:
45-
externalAccess:
46-
- type: legacy
47-
options:
48-
subject: legacy-default-config
49-
secret: "${BACKEND_SECRET}"
50-
baseUrl: {my-product-url}
51-
cors:
52-
origin: {my-product-url}
45+
includes:
46+
- dynamic-plugins.default.yaml
47+
plugins:
48+
- package: ./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github
49+
disabled: false
50+
- package: ./dynamic-plugins/dist/backstage-community-plugin-rbac
51+
disabled: false
5352
----
54-
====
55-
56-
** Optionally, enter your configuration such as:
57-
58-
*** {authentication-book-link}[{authentication-book-title}].
59-
*** {authorization-book-link}[{authorization-book-title}].
60-
*** {customizing-book-link}[Customization].
6153

6254
. Provision your custom configuration files to your {platform} cluster.
6355

@@ -68,21 +60,25 @@ backend:
6860
$ oc create namespace {my-product-namespace}
6961
----
7062

71-
.. Provision your `{my-app-config-file}` file to the `{my-app-config-config-map}` config map in the _<{my-product-namespace}>_ project.
63+
.. Provision your `{my-app-config-file}` and `dynamic-plugins.yaml` files respectively to the `{my-app-config-config-map}` and `dynamic-plugins-rhdh` config maps in the _<{my-product-namespace}>_ project.
7264
+
7365
[source,terminal,subs="+attributes,+quotes"]
7466
----
7567
$ oc create configmap {my-app-config-config-map} --from-file={my-app-config-file} --namespace={my-product-namespace}
68+
$ oc create configmap dynamic-plugins-rhdh --from-file=dynamic-plugins.yaml --namespace={my-product-namespace}
7669
----
70+
+
71+
Alternatively,
72+
link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/nodes/index#nnodes-pods-configmap-create-from-console_configmaps[create the config maps by using the web console].
7773

78-
.. Provision your `_<my_product_secrets>_.txt` file to the `_<my_product_secrets>_` secret in the _<{my-product-namespace}>_ project.
74+
.. Provision your `secrets.txt` file to the `{my-product-secrets}` secret in the _<{my-product-namespace}>_ project.
7975
+
8076
[source,terminal,subs="+attributes,+quotes"]
8177
----
82-
$ oc create secret generic `_<my_product_secrets>_` --from-file=`_<my_product_secrets>_.txt` --namespace={my-product-namespace}
78+
$ oc create secret generic {my-product-secrets} --from-file=secrets.txt --namespace={my-product-namespace}
8379
----
80+
+
81+
Alternatively,
82+
link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/nodes/index#nodes-pods-secrets-creating-web-console-secrets_nodes-pods-secrets[create the secret by using the web console].
8483

85-
.Next steps
86-
* To use an external PostgreSQL database, {configuring-book-link}configuring-external-postgresql-databases[provision your PostgreSQL database secrets].
87-
* To enable dynamic plugins, {installing-and-viewing-plugins-book-link}[provision your dynamic plugins config map].
88-
* To configure authorization by using external files, {authorization-book-link}#managing-authorizations-by-using-external-files[provision your RBAC policies config map].
84+
include::snip-provisioning-your-custom-configuration-next-steps-in-{context}-context.adoc[]
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="proc-configuring-an-rhdh-instance-with-tls-in-kubernetes_{context}"]
4+
[id="using-the-operator-to-run-rhdh-with-your-custom-configuration"]
5+
= Using the {product} Operator to run {product-short} with your custom configuration
6+
7+
To use the {product-short} Operator to run {product} with your custom configuration, create your {product-custom-resource-type} custom resource (CR) that:
8+
9+
* Mounts files provisioned in your custom config maps.
10+
* Injects environment variables provisioned in your custom secrets.
11+
12+
.Prerequisites
13+
* By using the link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/cli_tools/index#cli-about-cli_cli-developer-commands[{openshift-cli}], you have access, with developer permissions, to the {ocp-short} cluster aimed at containing your {product-short} instance.
14+
* xref:proc-install-operator_getting-started-with-rhdh-on-ocp-for-the-platform-engineer[]
15+
* xref:provisioning-your-custom-configuration[]
16+
17+
.Procedure
18+
19+
. Author your {product-custom-resource-type} CR in a `{my-product-cr-name}.yaml` file to use your custom config maps and secrets.
20+
+
21+
.`{my-product-cr-name}.yaml` custom resource example with dynamic plugins and RBAC policies config maps, and external PostgreSQL database secrets.
22+
[source,yaml,subs="+attributes,+quotes"]
23+
----
24+
apiVersion: rhdh.redhat.com/v1alpha3
25+
kind: Backstage
26+
metadata:
27+
name: _<{my-product-cr-name}>_
28+
spec:
29+
application:
30+
appConfig:
31+
mountPath: /opt/app-root/src
32+
configMaps:
33+
- name: {my-app-config-config-map}
34+
- name: rbac-policies
35+
dynamicPluginsConfigMapName: dynamic-plugins-rhdh
36+
extraEnvs:
37+
envs:
38+
- name: HTTP_PROXY
39+
value: 'http://10.10.10.105:3128'
40+
- name: HTTPS_PROXY
41+
value: 'http://10.10.10.106:3128'
42+
- name: NO_PROXY
43+
value: 'localhost,example.org'
44+
secrets:
45+
- name: {my-product-secrets}
46+
extraFiles:
47+
mountPath: /opt/app-root/src
48+
secrets:
49+
- name: {my-product-database-certificates-secrets}
50+
key: postgres-crt.pem, postgres-ca.pem, postgres-key.key
51+
replicas: 2
52+
database:
53+
enableLocalDb: false
54+
----
55+
56+
`application`::
57+
`appConfig`::: Register your `{my-app-config-config-map}` and `rbac-policies` config maps.
58+
`dynamicPluginsConfigMapName`::: Register your `dynamic-plugins-rhdh` config map.
59+
`extraEnvs`:::
60+
`env`:::: Enter your proxy environment variables.
61+
`secrets`:::: Register your `<my_product_secrets>` and `{my-product-database-secrets}` secrets.
62+
`extraFiles`:::
63+
`secrets`::::
64+
Register the `postgres-crt.pem`, `postgres-ca.pem`, and `postgres-key.key` files contained in the `{my-product-database-certificates-secrets}` secret.
65+
`replicas`::: Enable high availability (HA) by increasing the replicas count to a value higher or equal to 2.
66+
`database`::
67+
`enableLocalDb`::: Use your external PostgreSQL database rather than the internal PostgreSQL database.
68+
69+
. Apply your {product-custom-resource-type} CR to start or update your {product-short} instance.
70+
+
71+
[source,terminal,subs="+attributes,+quotes"]
72+
----
73+
$ oc apply --filename={my-product-cr-name}.yaml --namespace={my-product-namespace}
74+
----

0 commit comments

Comments
 (0)