Skip to content

Repository files navigation

Catalog Service

This application is part of the Polar Bookshop system and provides the functionality for managing the books in the bookshop catalog. It's part of the project built in the Cloud Native Spring in Action book by Thomas Vitale.

Useful Commands

Gradle Command Description
./gradlew bootRun Run the application.
./gradlew build Build the application.
./gradlew test Run tests.
./gradlew bootJar Package the application as a JAR.
./gradlew bootBuildImage Package the application as a container image.

After building the application, you can also run it from the Java CLI:

java -jar build/libs/catalog-service-0.0.1-SNAPSHOT.jar

Container tasks

Run Catalog Service as a container

docker run --rm --name catalog-service -p 8080:8080 catalog-service:0.0.1-SNAPSHOT

Container Commands

Docker Command Description
docker stop catalog-service Stop container.
docker start catalog-service Start container.
docker remove catalog-service Remove container.

Kubernetes tasks

Create Deployment for application container

kubectl create deployment catalog-service --image=catalog-service:0.0.1-SNAPSHOT

Create Service for application Deployment

kubectl expose deployment catalog-service --name=catalog-service --port=8080

Port forwarding from localhost to Kubernetes cluster

kubectl port-forward service/catalog-service 8000:8080

Delete Deployment for application container

kubectl delete deployment catalog-service

Delete Service for application container

kubectl delete service catalog-service

About

Cloud Native Spring

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages