The catalog-service with database
You have learned the essential knowledge to understand how to work with persistent storage in the OpenShift cloud. Now, let's take a look at this with a practical example. Let's update ourcatalog-service
deployment so that it connects to the database.
Configuring PostgreSQL database
First, let's ensure that we have removed the previous version of thecatalog-service
. In order to do that, we will need to use the oc
delete command. The command interface is the same as the interface for the get operation. You will be able to delete an object by directly specifying its name or use labels to indicate objects that you want to delete. There are many objects related to a single application, and we obviously don't want to delete them one by one. As a result, we will use the label version of the delete
command for that:
oc delete all -l app=catalog-service
Now, we are ready to deploy the database. Open your web console and click on the Add to the Project
button. We will...