Skip to content

Commit

Permalink
RHIDP-2384: Move procedural steps to Configuring the RHDH CR section
Browse files Browse the repository at this point in the history
rh-pre-commit.version: 2.2.0
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
linfraze committed May 20, 2024
1 parent 2240168 commit 420119b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 36 deletions.
38 changes: 3 additions & 35 deletions modules/installation/proc-add-custom-app-config-file-ocp.adoc
Original file line number Diff line number Diff line change
@@ -1,42 +1,10 @@
[id="proc-add-custom-app-config-file-ocp_{context}"]
= Adding a custom application configuration file to {ocp-short}

To change the configuration of your {product} instance, you must do the following:

* Add a custom application configuration file to {ocp-short} and reference it in the Custom Resource (CR). In {ocp-short}, you can use the following example as a base template to create a ConfigMap such as `app-config-rhdh.yaml`:
+
[source,yaml,subs="attributes+"]
----
kind: ConfigMap
apiVersion: v1
metadata:
name: app-config-rhdh
data:
"app-config-rhdh.yaml": |
app:
title: {product}
baseUrl: https://backstage-developer-hub-my-ns.apps.ci-ln-vtkzr22-72292.origin-ci-int-gce.dev.rhcloud.com
backend:
auth:
keys:
- secret: "${BACKEND_SECRET}"
baseUrl: https://backstage-backstage-sample-my-ns.apps.ci-ln-vtkzr22-72292.origin-ci-int-gce.dev.rhcloud.com
cors:
origin: https://backstage-backstage-sample-my-ns.apps.ci-ln-vtkzr22-72292.origin-ci-int-gce.dev.rhcloud.com
----
+
* Use the mandatory backend auth key for {product} to reference an environment variable defined in an {ocp-short} Secret.
* Set the external URL of your {product} instance in the `app.baseUrl`, `backend.baseUrl` and `backend.cors.origin` fields of the application configuration. By default, the URL is similar to the following example:
`pass:c[https://backstage-<CUSTOM_RESOURCE_NAME>-<NAMESPACE_NAME>.<OPENSHIFT_INGRESS_DOMAIN>;]`.
** You can use the `oc get ingresses.config/cluster -o jsonpath='{.spec.domain}'` command to display your ingress domain. If you want to use a different host or sub-domain, customize the `Custom Resource spec.application.route field` and adjust the application configuration accordingly.

[NOTE]
====
You are responsible for protecting your {product} installation from external and unauthorized access. Manage the backend auth key like any other secret. Meet strong password requirements, do not expose it in any configuration files, and only inject it into configuration files as an environment variable.
====
= Adding a custom application configuration file to {ocp-short} using the Operator

.Prerequisites
* You have an active {ocp-brand-name} account.
* An administrator has configured the Custom Resource (CR) for your {product-short} instance.
// specify the type of administrator and the platform/product for which that role is required

.Procedure
. From the *Developer* perspective, select the *ConfigMaps* tab.
Expand Down
51 changes: 50 additions & 1 deletion modules/installation/proc-config-rhdh-custom-resource.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,53 @@
[id="proc-config-rhdh-custom-resource_{context}"]
= Configuring the {product-short} Custom Resource

Updates to the Backstage custom resource (CR) are automatically handled by the {product} Operator. However, updates to resources referenced by the CR, such as ConfigMaps or Secrets, are not updated automatically unless the CR itself is updated. If you want to update resources referenced by the CR, then you must manually delete the Backstage Deployment so that the Operator can re-create it with the updated resources.
You can change the configuration of the Custom Resource (CR) for your {product} instance.
// Explain why a user would want/need to do this.

[NOTE]
====
Updates to the Backstage CR are automatically handled by the {product} Operator. However, updates to resources referenced by the CR, such as ConfigMaps or Secrets, are not updated automatically unless the CR itself is updated. If you want to update resources referenced by the CR, then you must manually delete the Backstage Deployment so that the Operator can re-create it with the updated resources.
====

// .Prerequisites
// You have an administrative role in {product}

.Procedure

To configure your {product-short} CR file, complete the following steps:

. Add a custom application configuration file to {ocp-short} and reference it in the CR. In {ocp-short}, you can use the following example as a base template to create a ConfigMap, such as `app-config-rhdh.yaml`:
+
[source,yaml,subs="attributes+"]
----
kind: ConfigMap
apiVersion: v1
metadata:
name: app-config-rhdh
data:
"app-config-rhdh.yaml": |
app:
title: {product}
baseUrl: https://backstage-developer-hub-my-ns.apps.ci-ln-vtkzr22-72292.origin-ci-int-gce.dev.rhcloud.com
backend:
auth:
keys:
- secret: "${BACKEND_SECRET}"
baseUrl: https://backstage-backstage-sample-my-ns.apps.ci-ln-vtkzr22-72292.origin-ci-int-gce.dev.rhcloud.com
cors:
origin: https://backstage-backstage-sample-my-ns.apps.ci-ln-vtkzr22-72292.origin-ci-int-gce.dev.rhcloud.com
----
+
. Use the mandatory backend authentication key for {product} to reference an environment variable defined in an {ocp-short} Secret.
. Set the external URL of your {product} instance in the `app.baseUrl`, `backend.baseUrl` and `backend.cors.origin` fields of the application configuration. By default, the URL is similar to the following example:
`pass:c[https://backstage-<CUSTOM_RESOURCE_NAME>-<NAMESPACE_NAME>.<OPENSHIFT_INGRESS_DOMAIN>;]`.

[NOTE]
====
You can use the `oc get ingresses.config/cluster -o jsonpath='{.spec.domain}'` command to display your ingress domain. If you want to use a different host or sub-domain, customize the `Custom Resource spec.application.route field` and adjust the application configuration accordingly.
====

[NOTE]
====
You are responsible for protecting your {product} installation from external and unauthorized access. Manage the backend auth key like any other secret. Meet strong password requirements, do not expose it in any configuration files, and only inject it into configuration files as an environment variable.
====

0 comments on commit 420119b

Please sign in to comment.