The Assignment App is a Spring Boot-based REST application supporting basic CRUD operations for managing customers. It includes endpoints for creating, reading, updating, and deleting customer records and is configured to run locally using Docker or on a Minikube cluster with an in-memory database.
-
CRUD Operations:
- Create a customer.
- Retrieve all customers or a specific customer by ID.
- Update a customer record.
- Delete a customer record.
-
Local Container Support:
- Easily run the application locally using
docker-compose
.
- Easily run the application locally using
-
Minikube Deployment:
- Deploy the application on a Minikube cluster with an in-memory database.
- Ensure Docker is installed and running on your machine.
- Navigate to the project root directory.
- Run the following command to start the application:
docker-compose up
- You can check if the application is alive at: http://localhost:8087/assignment/alive
Follow these steps to deploy the application on a Minikube cluster:
Step 1: Create a Deployment:
kubectl create deployment assignment-app --image=assignment_v
Step 2: Build the Docker Image:
docker build . -t assignment_v1
Step 3: Load the Image into Minikube:
minikube image load assignment_v1
Step 4: Expose the Deployment:
kubectl expose deployment assignment-app --type=NodePort --port=8087
Step 5: Access the Application externally as a service:
minikube service assignment-app --url
This step will return a url in response like http://127.0.0.1:62532 - This will be the base url for all APIs
Notes
1. The application uses an in-memory database for quick setup and testing.
2. Ensure Minikube is installed and running correctly before starting the deployment process.
3. The browser access URL (http://127.0.0.1:<port>) is only available on the machine where Minikube is running.
• Cannot access the service in the browser: Ensure Minikube is running and the deployment is exposed correctly.
• Docker image not found in Minikube: Verify that the image was built and loaded into Minikube using the correct name.
Swagger doc can be accessed here - http://localhost:8081/swagger-ui/index.html