This demo deploys a Quarkus TODO app in an hybrid cloud using Skupper and Kubernetes/OpenShift. The database used is CockroachDB as it is a database that fits perfectly the needs of replication information across different clusters.
Rename the .env.example
to .env
and fill with the information required to access to your clusters.
make create_namespace_1
make create_namespace_2
make deploy_single_cockroachdb
make db
make deploy_backend_1
make frontend_1
make expose_1
make backend_cluster_1
make backend_cluster_2
make deploy_backend_2
make create_namespace_1
make create_namespace_2
make cluster_1
make cluster_2
make db
make backend
make frontend
make expose
You can run the application on local machine with a single CockroachDB node.
You need to have Docker running to start CockroachDB.
Open 3 terminal windows:
docker run -ti --rm --name roach -p 8888:8080 -p 26257:26257 cockroachdb/cockroach:v20.2.3 start-single-node --insecure
docker exec -ti roach ./cockroach sql --insecure --execute="CREATE DATABASE todo;"
cd todo-backend
./mvnw clean package -DskipTests
java -Dquarkus.http.port=9090 -Dquarkus.datasource.jdbc.url=jdbc:postgresql://localhost:26257/todo -jar target/todo-backend-1.0.0-runner.jar
cd todo-frontend
./mvnw clean package -DskipTests
java -Dio.quarkus.sample.BackendService/mp-rest/url=http://localhost:9090 -jar target/todo-frontend-1.0.0-runner.jar
Open a browser and access to http://localhost:8080/todo.html
If you want to run the demo in Quarkus dev mode you can do it as in this mode the backends are configured in different ports and embedded H2 is used instead of CockroachDB.
Open two terminals:
cd todo-backend
./mvnw compile quarkus:dev
cd todo-frontend
./mvnw compile quarkus:dev
Open a browser and access to http://localhost:8080/todo.html