Use the Topology view for the following purposes:
Grouping multiple components within an application.
Connecting components with each other.
Connecting multiple resources to services with labels.
You can either use a binding or a visual connector to connect components.
A binding connection between the components can be established only if the target node is an Operator-backed service. This is indicated by the Create a binding connector tool-tip which appears when you drag an arrow to such a target node. When an application is connected to a service by using a binding connector a ServiceBinding
resource is created. Then, the Service Binding Operator controller projects the necessary binding data into the application deployment. After the request is successful, the application is redeployed establishing an interaction between the connected components.
A visual connector establishes only a visual connection between the components, depicting an intent to connect. No interaction between the components is established. If the target node is not an Operator-backed service the Create a visual connector tool-tip is displayed when you drag an arrow to a target node.
As a user, if you want to create a bindable service, you must know which services are bindable. Bindable services are services that the applications can consume easily because they expose their binding data such as credentials, connection details, volume mounts, secrets, and other binding data in a standard way. The Developer perspective helps you discover and identify such bindable services.
To discover and identify Operator-backed bindable services, consider the following alternative approaches:
Click +Add → Developer Catalog → Operator Backed to see the Operator-backed tiles. Operator-backed services that support service binding features have a Bindable badge on the tiles.
On the left pane of the Operator Backed page, select Bindable.
Click the help icon next to Service binding to see more information about bindable services. |
Click +Add → Add and search for Operator-backed services. When you click the bindable service, you can view the Bindable badge in the side panel.
You can depict an intent to connect application components by using the visual connector.
This procedure walks you through an example of creating a visual connection between a PostgreSQL Database service and a Spring PetClinic sample application.
You have created and deployed a Spring PetClinic sample application by using the Developer perspective.
You have created and deployed a Crunchy PostgreSQL database instance by using the Developer perspective. This instance has the following components: hippo-backup
, hippo-instance
, hippo-repo-host
, and hippo-pgbouncer
.
In the Developer perspective, switch to the relevant project, for example, my-petclinic
.
Hover over the Spring PetClinic sample application to see a dangling arrow on the node.
Click and drag the arrow towards the hippo-pgbouncer
deployment to connect the Spring PetClinic sample application with it.
Click the spring-petclinic
deployment to see the Overview panel. Under the Details tab, click the edit icon in the Annotations section to see the Key = app.openshift.io/connects-to
and Value = [{"apiVersion":"apps/v1","kind":"Deployment","name":"hippo-pgbouncer"}]
annotation added to the deployment.
Optional: You can repeat these steps to establish visual connections between other applications and components you create.
You can create a binding connection with Operator-backed components, as demonstrated in the following example, which uses a PostgreSQL Database service and a Spring PetClinic sample application. To create a binding connection with a service that the PostgreSQL Database Operator backs, you must first add the Red Hat-provided PostgreSQL Database Operator to the OperatorHub, and then install the Operator. The PostreSQL Database Operator then creates and manages the Database resource, which exposes the binding data in secrets, config maps, status, and spec attributes.
You created and deployed a Spring PetClinic sample application in the Developer perspective.
You installed Service Binding Operator from the OperatorHub.
You installed the Crunchy Postgres for Kubernetes Operator from the OperatorHub in the v5
Update channel.
You created a PostgresCluster resource in the Developer perspective, which resulted in a Crunchy PostgreSQL database instance with the following components: hippo-backup
, hippo-instance
, hippo-repo-host
, and hippo-pgbouncer
.
In the Developer perspective, switch to the relevant project, for example, my-petclinic
.
In the Topology view, hover over the Spring PetClinic sample application to see a dangling arrow on the node.
Drag and drop the arrow onto the hippo database icon in the Postgres Cluster to make a binding connection with the Spring PetClinic sample application.
In the Create Service Binding dialog, keep the default name or add a different name for the service binding, and then click Create.
Optional: If there is difficulty in making a binding connection using the Topology view, go to +Add → YAML → Import YAML.
Optional: In the YAML editor, add the ServiceBinding
resource:
apiVersion: binding.operators.coreos.com/v1alpha1
kind: ServiceBinding
metadata:
name: spring-petclinic-pgcluster
namespace: my-petclinic
spec:
services:
- group: postgres-operator.crunchydata.com
version: v1beta1
kind: PostgresCluster
name: hippo
application:
name: spring-petclinic
group: apps
version: v1
resource: deployments
A service binding request is created and a binding connection is created through a ServiceBinding
resource. When the database service connection request succeeds, the application is redeployed and the connection is established.
You can also use the context menu by dragging the dangling arrow to add and create a binding connection to an operator-backed service. Figure 5. Context menu to create binding connection
|
In the navigation menu, click Topology. The spring-petclinic deployment in the Topology view includes an Open URL link to view its web page.
Click the Open URL link.
You can now view the Spring PetClinic sample application remotely to confirm that the application is now connected to the database service and that the data has been successfully projected to the application from the Crunchy PostgreSQL database service.
The Service Binding Operator has successfully created a working connection between the application and the database service.
The Developer perspective helps you verify the status of your service binding through the Topology view.
If a service binding was successful, click the binding connector. A side panel appears displaying the Connected status under the Details tab.
Optionally, you can view the Connected status on the following pages from the Developer perspective:
The ServiceBindings page.
The ServiceBinding details page. In addition, the page title displays a Connected badge.
If a service binding was unsuccessful, the binding connector shows a red arrowhead and a red cross in the middle of the connection. Click this connector to view the Error status in the side panel under the Details tab. Optionally, click the Error status to view specific information about the underlying problem.
You can also view the Error status and a tooltip on the following pages from the Developer perspective:
The ServiceBindings page.
The ServiceBinding details page. In addition, the page title displays an Error badge.
In the ServiceBindings page, use the Filter dropdown to list the service bindings based on their status. |
As a user, use Label Selector in the Topology view to visualize a service binding and simplify the process of binding applications to backing services. When creating ServiceBinding
resources, specify labels by using Label Selector to find and connect applications instead of using the name of the application. The Service Binding Operator then consumes these ServiceBinding
resources and specified labels to find the applications to create a service binding with.
To navigate to a list of all connected resources, click the label selector associated with the |
To view the Label Selector, consider the following approaches:
After you import a ServiceBinding
resource, view the Label Selector associated with the service binding on the ServiceBinding details page.
To use Label Selector and to create one or more connections at once, you must import the YAML file of the |
After the connection is established and when you click the binding connector, the service binding connector Details side panel appears. You can view the Label Selector associated with the service binding on this panel.