This Jakarta Enterprise Edition example shows how to deploy an application to the Kubernetes Bare Metal LeoCloud by continuous delivery.
It is made up of the following components:
- a mysql Database
- a SPA Browser Client Application implemented in Javascript accessing either the quarkus backend or the express server backend.
- a supersonic fast application server implemented with quarkus, compiled to a native image
- a nodejs express server accessing the same database as an alternative to Quarkus
The Application is currently deployed on the LeoCloud
When the source code is pushed the docker images are built automatically with github actions.
To start the database for local development open a terminal in the docker subfolder and run the following:
cd ./docker/mysql
docker-compose up --build
To reset the project and clean the database you can run
make clean
to build the application on the local machine run the following:
mvn -Dquarkus.profile=dev clean package
java -jar appsrv/target/application-server-0.5.0-runner.jar
You can explore the SwaggerUI API with using http://localhost:8080/q/swagger-ui/
You can download the openapi specification file with http://localhost:8080/q/openapi and use the openapi code generator to automatically generate REST clients in Java, Typescript, Javascript etc. etc.
This is the application server See the appsrv subfolder for how to use REST/JPA/CDI in Quarkus
see the www subfolder for the javascript client
See the application subfolder. This application is out of date, contributions welcome!
see appsrc/src/test/resources for a feature test. To see the coverage report run the following:
cd ./appsrv
mvn clean compile test jacoco:report
Then open appsrv/target/site/jacoco/index.html. As you see only Person has been tested. Contributions are welcome.
Before we deploy to a real cloud we test our application on minikube. First of all we install minikube. This is described here. For Installing kubernetes on Docker Desktop read this article. Note: kubernetes on Desktop does not have the standard storage class, you can create it with this yaml
You have to get your credentials from the cloud, adjust your namespace and baseUrl, then you can deploy the application with:
kubectl deploy -f k8s/app.yaml
On every push the application is compiled and uploaded to the cloud registry. See the "Actions" tab in this github project for details. See also CI/CD und DevOps in my blog.
The Demo can be seen at https://student.cloud.htl-leonding.ac.at/c.aberger/