Blindfolded debugging… Not today!!
15 MINUTE PRACTICE
The Mysterious Application in your developer environment is now up and running. It is composed of several components, but so far, you have no clue about how the application is working. Going all over this application and debugging it completely blindfolded is time consuming and a crazy bid.
Red Hat OpenShift Container Platform provides services to get observability of applications and to understand how different components are interacting with each other.
Kiali, please tell me, how is this application working?
Kiali provides an interactive graph view of your namespace in real time, being able to display the interactions at several levels (applications, versions, workloads), with contextual information and charts on the selected graph node or edge.
Click on the 'Developer Observability' button below
Then, log in with OpenShift as user%USER_ID%/%OPENSHIFT_PASSWORD%'
In the 'Graph' view, enter the following configuration:
| Parameter | Value |
|---|---|
Namespace |
staging-project%USER_ID% |
Type Graph |
Versioned app graph |
Display |
'Traffic Animation' checked |
Hide |
node = unknown OR service*=PassthroughCluster |
The outcome is a graph with all the services, connected by the requests going through them. You can see how the services interact with each other.
|
In order to get the previous screen, you need to generate traffic. |
Even if the application seemed working fine, please compare the all Services you have between the OpenShift Console and the Kiali Graph.
Have you found the one difference? Great! Let’s investigate!
| This is a database missing from the Kiali Graph… |
Check the Catalog Service Configuration
You clearly see that the Catalog PostgreSQL Service is not a part of the Kiali graph. That means this service is not called by the Catalog Service as it should be.
In the OpenShift Web Console, from the Developer view,
click on 'ConfigMaps' > 'catalog'.
Take a look at the Data Section. Catalog Service is configured with the development parameters.
Indeed, it is currently configured with an InMemory Database (H2), which is used for development purposes only.
This is the reason why the Catalog PostgreSQL Service is not currently using.
Fix the issue
Let’s change the configuration to connect the Catalog Service to the PostgreSQL database.
Click on the tab 'YAML' of the 'CM catalog' and update the content as follows:
data:
application.properties: |
spring.application.name=catalog
server.port=8080
spring.datasource.url=jdbc:postgresql://catalog-postgresql:5432/catalogdb(1)
spring.datasource.username=catalog
spring.datasource.password=catalog
spring.datasource.driver-class-name=org.postgresql.Driver(2)
spring.jpa.hibernate.ddl-auto=create
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
| 1 | PostgreSQL JDBC URL |
| 2 | PostgresSQL driver |
The result should look like as follows:
Then, click on 'Save'.
Now, you have to re-deploy the Catalog Service with the latest configuration.
Go back to 'Topology', click on the 'DC catalog-v1' bubble and select 'Start Rollout' action
Once the application is up and running, refresh your browser opened on the Coolstore Application
and visualize the change on the Kiali graph.
You survived and you put off the blindfold on your own. But it is not THE END …
Now, let’s go deeper!!
