Skip to content

Commit f470a89

Browse files
authored
Merge branch 'main' into RHIPD-8629
2 parents 36430ea + 9f7dd3e commit f470a89

10 files changed

+157
-66
lines changed

assemblies/assembly-configuring-templates.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ include::modules/customizing-templates/proc-searching-and-filtering-software-tem
2020
include::modules/customizing-templates/proc-adding-templates.adoc[leveloffset=+1]
2121
include::modules/customizing-templates/proc-versioning-software-templates.adoc[leveloffset=+1]
2222
include::modules/customizing-templates/proc-enabling-software-template-version-update-notifications.adoc[leveloffset=+1]
23+
include::assembly-tracking-component-origin-and-software-template-version.adoc[leveloffset=+1]
2324

2425
[role="_additional-resources"]
2526
.Additional resources
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
3+
[id="tracking-component-origin-and-software-template-version"]
4+
= Tracking Component origin and Software Template version
5+
6+
Platform engineers use custom actions within the Software Template scaffolding process to establish and track the dependency link between a generated entity (Component or Resource) and its source template. This relationship is called scaffolding provenance.
7+
8+
Platform administrators use custom actions such as `catalog:scaffolded-from` and `catalog:template:version` in the scaffolder backend module to track the template version and the corresponding entity version, which simplifies lifecycle management.
9+
10+
include::modules/tracking-component-origin-and-software-template-version/proc-configuring-provenance-and-software-template-versioning.adoc[leveloffset=+1]
11+
12+
include::modules/tracking-component-origin-and-software-template-version/proc-viewing-software-template-dependencies.adoc[leveloffset=+1]

modules/authentication/snip-enabling-user-authentication-with-rhbk-common-first-steps.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This plugin imports {rhbk} users and groups to the {product-short} software cata
5151
[source,yaml]
5252
----
5353
plugins:
54-
- package: './dynamic-plugins/dist/backstage-plugin-catalog-backend-module-keycloak-dynamic'
54+
- package: './dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-keycloak-dynamic'
5555
disabled: false
5656
----
5757

modules/dynamic-plugins/proc-extensions-enabling-plugins-installation-rhdh-local.adoc

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,23 @@ plugins:
2323
dynamicPlugins:
2424
frontend:
2525
red-hat-developer-hub.backstage-plugin-marketplace:
26+
translationResources:
27+
- importName: marketplaceTranslations
28+
ref: marketplaceTranslationRef
29+
module: Alpha
2630
appIcons:
27-
- name: marketplace
28-
importName: MarketplaceIcon
31+
- name: pluginsIcon
32+
importName: PluginsIcon
2933
dynamicRoutes:
30-
- path: /extensions/catalog
34+
- path: /extensions
3135
importName: DynamicMarketplacePluginRouter
32-
mountPoints:
33-
- mountPoint: application/provider
34-
importName: InstallationContextProvider
35-
- mountPoint: internal.plugins/tab
36-
importName: DynamicMarketplacePluginContent
37-
config:
38-
path: marketplace
39-
title: Catalog
36+
menuItem:
37+
icon: pluginsIcon
38+
text: Extensions
39+
textKey: menuItem.extensions
40+
menuItems:
41+
extensions:
42+
parent: default.admin
4043
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic
4144
disabled: false
4245
pluginConfig:
@@ -46,6 +49,10 @@ plugins:
4649
saveToSingleFile:
4750
file: /opt/app-root/src/configs/dynamic-plugins/dynamic-plugins.override.yaml
4851
----
52+
where:
53+
54+
`translationResources`:: Sets the extension point for localization.
55+
4956
. Update your `compose.yaml` file:
5057
+
5158
[source,yaml]

modules/dynamic-plugins/proc-extensions-enabling-plugins-installation.adoc

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,23 @@ plugins:
2727
dynamicPlugins:
2828
frontend:
2929
red-hat-developer-hub.backstage-plugin-marketplace:
30+
translationResources:
31+
- importName: marketplaceTranslations
32+
ref: marketplaceTranslationRef
33+
module: Alpha
3034
appIcons:
31-
- name: marketplace
32-
importName: MarketplaceIcon
35+
- name: pluginsIcon
36+
importName: PluginsIcon
3337
dynamicRoutes:
34-
- path: /extensions/catalog
38+
- path: /extensions
3539
importName: DynamicMarketplacePluginRouter
36-
mountPoints:
37-
- mountPoint: application/provider
38-
importName: InstallationContextProvider
39-
- mountPoint: internal.plugins/tab
40-
importName: DynamicMarketplacePluginContent
41-
config:
42-
path: marketplace
43-
title: Catalog
44-
icon: CatalogTabIcon
40+
menuItem:
41+
icon: pluginsIcon
42+
text: Extensions
43+
textKey: menuItem.extensions
44+
menuItems:
45+
extensions:
46+
parent: default.admin
4547
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic
4648
disabled: false
4749
pluginConfig:
@@ -51,6 +53,9 @@ plugins:
5153
saveToSingleFile:
5254
file: /opt/app-root/src/dynamic-plugins-root/dynamic-plugins.extensions.yaml
5355
----
56+
where:
57+
`translationResources`:: Sets the extension point for localization.
58+
5459
. Copy the file to your cluster by running the following commands:
5560
+
5661
[source,yaml]

modules/observe/proc-admin-enabling-metrics-ocp-helm.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[id="proc-admin-enabling-metrics-ocp-helm_{context}"]
44
= Enabling metrics monitoring in a Helm chart installation on an {ocp-short} cluster
55

6-
You can enable and view metrics for a {product} Helm deployment from the *Developer* perspective of the {ocp-short} web console.
6+
You can enable and view metrics for a {product} Helm deployment from the {ocp-short} web console. Metrics monitoring is enabled through configuration during a chart upgrade. After the upgrade, the Helm release generates the necessary `ServiceMonitor` resource.
77

88
.Prerequisites
99

@@ -12,7 +12,7 @@ You can enable and view metrics for a {product} Helm deployment from the *Develo
1212

1313
.Procedure
1414

15-
. From the *Developer* perspective in the {ocp-short} web console, select the *Topology* view.
15+
. From the {ocp-short} web console, select the *Topology* view.
1616
. Click the overflow menu of the {product} Helm chart, and select *Upgrade*.
1717
+
1818
image::rhdh/helm-upgrade.png[]
@@ -37,5 +37,5 @@ image::rhdh/upgrade-helm-metrics.png[]
3737

3838
.Verification
3939

40-
. From the *Developer* perspective in the {ocp-short} web console, select the *Observe* view.
40+
. From the {ocp-short} web console, select the *Observe* view.
4141
. Click the *Metrics* tab to view metrics for {product} pods.

modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
[id="proc-admin-enabling-metrics-ocp-operator_{context}"]
44
= Enabling metrics monitoring in a {product} Operator installation on an {ocp-short} cluster
55

6-
You can enable and view metrics for an Operator-installed {product} instance from the *Developer* perspective of the {ocp-short} web console.
6+
You can enable and view metrics for an Operator-installed {product} instance from the {ocp-short} web console. Metrics are exposed through an HTTP service endpoint under the `/metrics` canonical name.
7+
8+
By setting the `spec.monitoring.enabled` field to `true` in your {product} custom resource (CR), you instruct the Operator to automatically create and manage the necessary `ServiceMonitor` to scrape metrics from the service endpoint.
79

810
.Prerequisites
911

@@ -13,53 +15,29 @@ You can enable and view metrics for an Operator-installed {product} instance fro
1315

1416
.Procedure
1517

16-
Currently, the {product} Operator does not support creating a `ServiceMonitor` custom resource (CR) by default. You must complete the following steps to create a `ServiceMonitor` CR to scrape metrics from the endpoint.
17-
18-
. Create the `ServiceMonitor` CR as a YAML file:
18+
. Use the *OpenShift CLI* (`oc`) to edit your existing {product} CR.
19+
+
20+
[source,bash]
21+
----
22+
oc edit Backstage <instance-name>
23+
----
24+
. In the CR, locate the `spec` field and add the `monitoring` configuration block.
1925
+
20-
[source,yaml,subs="+attributes,+quotes"]
26+
[source,yaml]
2127
----
22-
apiVersion: monitoring.coreos.com/v1
23-
kind: ServiceMonitor
24-
metadata:
25-
name: _<developer_hub_service_monitor_name>_ <1>
26-
namespace: _<rhdh_namespace_name>_ <2>
27-
labels:
28-
app.kubernetes.io/instance: _<rhdh_cr_name>_ <3>
29-
app.kubernetes.io/name: {product-custom-resource-type}
3028
spec:
31-
namespaceSelector:
32-
matchNames:
33-
- _<rhdh_namespace_name>_ <4>
34-
selector:
35-
matchLabels:
36-
app.kubernetes.io/instance: _<deployment_name>_ <5>
37-
app.kubernetes.io/name: _<rhdh_cr_type>_ <6>
38-
endpoints:
39-
- port: http-metrics
40-
path: '/metrics'
29+
monitoring:
30+
enabled: true
4131
----
42-
<1> The name of your `ServiceMonitor` resource, for example, `developer_hub_service_monitor`.
43-
<2> The namespace where your `ServiceMonitor` will live, for example, `{my-product-namespace}`.
44-
<3> The label name identifying the `ServiceMonitor` CR instance, for example, `{my-product-cr-name}`.
45-
<4> The namespace where your {product-very-short} instance is installed, for example, `{my-product-namespace}`.
46-
<5> The name of your {product-very-short} deployment, for example, `developer-hub`.
47-
<6> The name of your {product-very-short} application, for example, `backstage`.
32+
. Save the {product-very-short} CR. The {product-very-short} Operator detects the configuration and automatically creates the corresponding `ServiceMonitor` custom resource (CR).
4833
+
4934
[NOTE]
5035
====
51-
`spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation.
36+
The Operator automatically configures the `ServiceMonitor` with the correct labels (`app.kubernetes.io/instance` and `app.kubernetes.io/name`) that match your Backstage CR. The `ServiceMonitor` will be named `metrics-<cr-name>`. No additional label configuration is required.
5237
====
5338

54-
. Apply the `ServiceMonitor` CR by running the following command:
55-
+
56-
[source,terminal]
57-
----
58-
oc apply -f <filename>
59-
----
60-
6139
.Verification
6240

63-
. From the *Developer* perspective in the {ocp-short} web console, select the *Observe* view.
41+
. From the {ocp-short} web console, select the *Observe* view.
6442
. Click the *Metrics* tab to view metrics for {product} pods.
65-
. From the Developer perspective in the {ocp-short} web console, click **Project > Services** and verify the labels for `backstage-developer-hub`.
43+
. From the {ocp-short} web console, click **Project > Services** and verify the labels for `backstage-developer-hub`.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="proc-configuring-provenance-and-software-template-versioning_{context}"]
4+
= Configuring provenance and Software Template versioning {product}
5+
6+
As a platform engineer, you must modify the Software Template YAML definition to ensure the required provenance information is added during the scaffolding process.
7+
8+
.Prerequisites
9+
10+
* You have administrator rights to {product}.
11+
12+
.Procedure
13+
14+
. Locate the Software Template object YAML file where you want to add the provenance information and add a step that uses the `catalog:scaffolded-from` action. This action links the resulting catalog entity back to the source template.
15+
. Optional: To track the template version (for example, v1.0 versus v1.5), include the `catalog:template:version` action in the `steps` section. The following code block is an example to adding versioning action to the `steps` section:
16+
+
17+
[source,yaml]
18+
----
19+
steps:
20+
- id: create-provenance-annotation
21+
name: Append the entityRef of this template to the entityRef
22+
action: catalog:scaffolded-from
23+
- id: create-version-annotation
24+
name: Create Template Version Annotation
25+
action: catalog:template:version
26+
input:
27+
templateVersion: ${{ parameters.version }}
28+
- ... other steps ...
29+
----
30+
+
31+
where:
32+
33+
`steps:input:templateVersion`:: Reads the version parameter
34+
+
35+
[NOTE]
36+
====
37+
The `catalog:template:version` action reads a version parameter defined in the template and applies it as an annotation to the resulting catalog entity.
38+
====
39+
40+
. In your {product} `{my-app-config-file}` file, configure the `catalog.locations` section to point to the Software Template that you want to add. You might need to add `Template` to the global `catalog.rules.allow` list or add a granular rule to the location to allow for Software Templates ingestion, as shown in the following example:
41+
+
42+
[source,yaml]
43+
----
44+
# ...
45+
catalog:
46+
locations:
47+
- type: url
48+
target: https://<repository_url>/example-template.yaml
49+
rules:
50+
- allow: [Template]
51+
# ...
52+
----
53+
+
54+
where:
55+
56+
`catalog.locations.type`:: Enter the `url` type if you are importing templates from a repository, such as GitHub or GitLab.
57+
`catalog.locations.target`:: Enter the URL for the template.
58+
`catalog.locations.rules.allow`:: Enter the `Template` rule to allow new Software Templates to be added to the catalog.
59+
60+
.Verification
61+
62+
After creating a component with the updated template, verify the provenance annotations in the resulting Catalog Entity YAML.
63+
64+
. In the {product} navigation menu, go to *Catalog* and locate the newly created catalog component.
65+
. To view the underlying data that links the entity to the template, select the **INSPECT ENTITY** option.
66+
. To verify provenance annotations, complete the following steps:
67+
.. Select the *YAML Raw* or *JSON Raw* view and verify the presence of the data item for the `scaffoldedFrom` link.
68+
.. Optional: If versioning was included, verify the presence of the `backstage.io/template-version` annotation.
69+
+
70+
[NOTE]
71+
====
72+
If you publish the catalog component to an external repository (such as Git), the component file in that repository must also contain the `backstage.io/template-version` annotation.
73+
====
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="proc-viewing-software-template-dependencies_{context}"]
4+
= Viewing Software Template dependencies
5+
6+
As a developer, you can track which entities were created from a specific Software Template. When a platform engineer configures provenance on a template, you can quickly identify the complete dependency and impact map of that template by viewing all linked components and resources in the Catalog.
7+
8+
.Procedure
9+
To view all components created from a specific template, complete the following steps:
10+
11+
. In the {product} navigation menu, click *Catalog*, use the filters to find and select the Software Template you wish to inspect.
12+
. In the Software Template detail page, click the *Dependencies* tab. This view lists all catalog entities such as components, resources, and systems that reference this template, including any version information if configured.

titles/customizing/master.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ include::assemblies/assembly-about-software-catalogs.adoc[leveloffset=+1]
2525

2626
include::assemblies/assembly-customizing-the-learning-paths.adoc[leveloffset=+1]
2727

28+
2829
include::assemblies/assembly-configuring-the-global-header.adoc[leveloffset=+1]
2930

3031

3132
include::assemblies/assembly-configuring-a-floating-action-button.adoc[leveloffset=+1]
3233

34+
3335
include::assemblies/assembly-configuring-the-quickstarts.adoc[leveloffset=+1]
3436

3537

@@ -44,4 +46,5 @@ include::assemblies/assembly-customizing-the-homepage.adoc[leveloffset=+1]
4446

4547
include::assemblies/assembly-customizing-the-quick-access-card.adoc[leveloffset=+1]
4648

49+
4750
include::modules/customizing/proc-customizing-rhdh-metadata-card.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)