This is a simple web service application built upon Spring Boot technology. Main function of this app is to provide information about items in Catalog.
Technology Stack used in this project:
- Spring Boot 2.5.1
- PostgreSQL 12
This app will be deployed as standalone jar on top OCP. We can use web console or CLI to deploy. We are assuming you are logged in into your cluster.
Deployment Steps:
- Create Project
oc new-project commerce-prd
- Create New Application
We deploy the application using
oc new-app
command:oc new-app openshift/java:openjdk-8-ubi8~https://github.com/rakhmad/catalog-service.git -e POSTGRESQL_HOST=postgresql --name=catalog-service
We use docker for database:
docker run -p 5432:5432 --name localdb -e POSTGRES_PASSWORD=<POSTGRES_PASSWORD> -d postgres:11
Connect to database, then create database, user and grant the access.
CREATE DATABASE catalog;
CREATE USER catalogsvc WITH ENCRYPTED PASSWORD 'r3dh4t1!';
GRANT ALL PRIVILEGES ON DATABASE catalog TO catalogsvc;