Skip to content

Commit cba5542

Browse files
author
GitHub Actions
committed
Modularize modules/dynamic-plugins/proc-topology-configur
1 parent f5ac51b commit cba5542

16 files changed

+387
-335
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="assembly-managing-labels-annotations-topology"]
3+
= Managing labels and annotations for Topology plugins
4+
:context: assembly-managing-labels-annotations-topology
5+
6+
include::modules/dynamic-plugins/proc-linking-to-source-code-editor-or-source.adoc[leveloffset=+1]
7+
8+
include::modules/dynamic-plugins/proc-entity-annotation-or-label.adoc[leveloffset=+1]
9+
10+
include::modules/dynamic-plugins/proc-namespace-annotation.adoc[leveloffset=+1]
11+
12+
include::modules/dynamic-plugins/proc-label-selector-query-annotation.adoc[leveloffset=+1]
13+
14+
include::modules/dynamic-plugins/proc-icon-displayed-in-the-node.adoc[leveloffset=+1]
15+
16+
include::modules/dynamic-plugins/proc-app-grouping.adoc[leveloffset=+1]
17+
18+
include::modules/dynamic-plugins/proc-node-connector.adoc[leveloffset=+1]
19+
20+
For more information about the labels and annotations, see _Guidelines for labels and annotations for OpenShift applications_.

Diff for: assemblies/assembly-topology-plugin-configure.adoc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="assembly-topology-plugin-configure"]
3+
= Configuring the Topology plugin
4+
:context: assembly-topology-plugin-configure
5+
6+
include::modules/dynamic-plugins/proc-viewing-openshift-routes.adoc[leveloffset=+1]
7+
8+
include::modules/dynamic-plugins/proc-viewing-pod-logs.adoc[leveloffset=+1]
9+
10+
include::modules/dynamic-plugins/proc-viewing-tekton-pipelineruns.adoc[leveloffset=+1]
11+
12+
include::modules/dynamic-plugins/proc-viewing-virtual-machines.adoc[leveloffset=+1]
13+
14+
include::modules/dynamic-plugins/proc-enabling-the-source-code-editor.adoc[leveloffset=+1]

Diff for: assemblies/dynamic-plugins/assembly-configuring-rhdh-plugins.adoc

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ include::../../artifacts/rhdh-plugins-reference/nexus-repository-manager/nexus-r
2020
include::../../artifacts/rhdh-plugins-reference/tekton/tekton-plugin-admin.adoc[leveloffset=+1]
2121

2222
// Topology
23-
== Installing and configuring the Topology plugin
23+
== Installing the Topology plugin
2424
include::../modules/dynamic-plugins/proc-topology-install.adoc[leveloffset=+2]
25-
include::../modules/dynamic-plugins/proc-topology-configure.adoc[leveloffset=+2]
25+
26+
include::../assembly-topology-plugin-configure.adoc[leveloffset=+1]
27+
28+
include::../assembly-managing-labels-annotations-topology.adoc[leveloffset=+1]
2629

2730
include::../assembly-bulk-importing-from-github.adoc[leveloffset=+1]
2831

Diff for: modules/dynamic-plugins/proc-app-grouping.adoc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[id="proc-app-grouping"]
2+
3+
= App grouping
4+
5+
To display workload resources such as deployments or pods in a visual group, add the following label:
6+
7+
[source,yaml]
8+
----
9+
labels:
10+
app.kubernetes.io/part-of: <GROUP_NAME>
11+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[id="proc-enabling-the-source-code-editor_{context}"]
2+
= Enabling the source code editor
3+
4+
To enable the source code editor, you must grant read access to the CheClusters resource in the `ClusterRole` as shown in the following example code:
5+
6+
[source,yaml]
7+
----
8+
...
9+
apiVersion: rbac.authorization.k8s.io/v1
10+
kind: ClusterRole
11+
metadata:
12+
name: backstage-read-only
13+
rules:
14+
...
15+
- apiGroups:
16+
- org.eclipse.che
17+
resources:
18+
- checlusters
19+
verbs:
20+
- get
21+
- list
22+
----
23+
24+
To use the source code editor, you must add the following configuration to the `kubernetes.customResources` property in your `{my-app-config-file}` file:
25+
26+
[source,yaml]
27+
----
28+
kubernetes:
29+
...
30+
customResources:
31+
- group: 'org.eclipse.che'
32+
apiVersion: 'v2'
33+
plural: 'checlusters'
34+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[id="proc-entity-annotation-or-label"]
2+
3+
= Entity annotation/label
4+
5+
For RHDH to detect that an entity has Kubernetes components, add the following annotation to the entity's `catalog-info.yaml`:
6+
7+
[source,yaml]
8+
----
9+
annotations:
10+
backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>
11+
----
12+
13+
The following label is added to the resources so that the Kubernetes plugin gets the Kubernetes resources from the requested entity, add the following label to the resources:
14+
15+
[source,yaml]
16+
----
17+
labels:
18+
backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>`
19+
----
20+
21+
[NOTE]
22+
====
23+
When using the label selector, the mentioned labels must be present on the resource.
24+
====
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[id="proc-icon-displayed-in-the-node"]
2+
3+
= Icon displayed in the node
4+
5+
To display a runtime icon in the topology nodes, add the following label to workload resources, such as Deployments:
6+
7+
[source,yaml]
8+
----
9+
labels:
10+
app.openshift.io/runtime: <RUNTIME_NAME>
11+
----
12+
Alternatively, you can include the following label to display the runtime icon:
13+
14+
[source,yaml]
15+
----
16+
labels:
17+
app.kubernetes.io/name: <RUNTIME_NAME>
18+
----
19+
20+
Supported values of `<RUNTIME_NAME>` include:
21+
22+
* django
23+
* dotnet
24+
* drupal
25+
* go-gopher
26+
* golang
27+
* grails
28+
* jboss
29+
* jruby
30+
* js
31+
* nginx
32+
* nodejs
33+
* openjdk
34+
* perl
35+
* phalcon
36+
* php
37+
* python
38+
* quarkus
39+
* rails
40+
* redis
41+
* rh-spring-boot
42+
* rust
43+
* java
44+
* rh-openjdk
45+
* ruby
46+
* spring
47+
* spring-boot
48+
49+
[NOTE]
50+
====
51+
Other values result in icons not being rendered for the node.
52+
====
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[id="proc-label-selector-query-annotation"]
2+
3+
= Label selector query annotation
4+
5+
You can write your own custom label, which RHDH uses to find the Kubernetes resources. The label selector takes precedence over the ID annotations:
6+
7+
[source,yaml]
8+
----
9+
annotations:
10+
backstage.io/kubernetes-label-selector: 'app=my-app,component=front-end'
11+
----
12+
13+
If you have multiple entities while Red Hat Dev Spaces is configured and want multiple entities to support the edit code decorator that redirects to the Red Hat Dev Spaces instance, you can add the backstage.io/kubernetes-label-selector annotation to the catalog-info.yaml file for each entity.
14+
15+
[source,yaml]
16+
----
17+
annotations:
18+
backstage.io/kubernetes-label-selector: 'component in (<BACKSTAGE_ENTITY_NAME>,che)'
19+
----
20+
21+
If you are using the previous label selector, you must add the following labels to your resources so that the Kubernetes plugin gets the Kubernetes resources from the requested entity:
22+
23+
[source,yaml]
24+
----
25+
labels:
26+
component: che # add this label to your che cluster instance
27+
labels:
28+
component: <BACKSTAGE_ENTITY_NAME> # add this label to the other resources associated with your entity
29+
----
30+
31+
You can also write your own custom query for the label selector with unique labels to differentiate your entities. However, you need to ensure that you add those labels to the resources associated with your entities including your CheCluster instance.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[id="proc-linking-to-source-code-editor-or-source"]
2+
3+
= Linking to the source code editor or the source
4+
5+
Add the following annotations to workload resources, such as Deployments to navigate to the Git repository of the associated application using the source code editor:
6+
7+
[source,yaml]
8+
----
9+
annotations:
10+
app.openshift.io/vcs-uri: <GIT_REPO_URL>
11+
----
12+
13+
Add the following annotation to navigate to a specific branch:
14+
15+
[source,yaml]
16+
----
17+
annotations:
18+
app.openshift.io/vcs-ref: <GIT_REPO_BRANCH>
19+
----
20+
21+
[NOTE]
22+
====
23+
If Red Hat OpenShift Dev Spaces is installed and configured and git URL annotations are also added to the workload YAML file, then clicking on the edit code decorator redirects you to the Red Hat OpenShift Dev Spaces instance.
24+
====
25+
26+
[NOTE]
27+
====
28+
When you deploy your application using the OCP Git import flows, then you do not need to add the labels as import flows do that. Otherwise, you need to add the labels manually to the workload YAML file.
29+
====
30+
31+
//The labels are not similar to `backstage.io/edit-url` annotations as it points to the catalog entity metadata source file and is applied to RHDH catalog entity metadata YAML file, but not Kubernetes resources.
32+
33+
You can also add the `app.openshift.io/edit-url` annotation with the edit URL that you want to access using the decorator.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[id="proc-namespace-annotation"]
2+
3+
= Namespace annotation
4+
5+
To identify the Kubernetes resources using the defined namespace, add the `backstage.io/kubernetes-namespace` annotation:
6+
7+
[source,yaml]
8+
----
9+
annotations:
10+
backstage.io/kubernetes-namespace: <RESOURCE_NS>
11+
----
12+
13+
The Red Hat OpenShift Dev Spaces instance is not accessible using the source code editor if the `backstage.io/kubernetes-namespace` annotation is added to the `catalog-info.yaml` file.
14+
15+
To retrieve the instance URL, you require the CheCluster custom resource (CR). As the CheCluster CR is created in the openshift-devspaces namespace, the instance URL is not retrieved if the namespace annotation value is not openshift-devspaces.

Diff for: modules/dynamic-plugins/proc-node-connector.adoc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[id="proc-node-connector"]
2+
3+
= Node connector
4+
5+
To display the workload resources such as deployments or pods with a visual connector, add the following annotation:
6+
7+
[source,yaml]
8+
----
9+
annotations:
10+
app.openshift.io/connects-to: '[{"apiVersion": <RESOURCE_APIVERSION>,"kind": <RESOURCE_KIND>,"name": <RESOURCE_NAME>}]'
11+
----

0 commit comments

Comments
 (0)