This is a Spring Boot version of the Kubernetes Guestbook application.
- Java 17
- Maven 3.6+
- Redis (for production use)
- Clone this repository
- Run the application:
mvn spring-boot:run
- Access the application at http://localhost:3000
-
Build the Docker image:
docker build -t guestbook:v1 .
-
Run the container:
docker run -p 3000:3000 guestbook:v1
-
Access the application at http://localhost:3000
-
Update the
deployment.yml
file with your namespace:image: us.icr.io/${YOUR_NAMESPACE}/guestbook:v1
-
Apply the deployment:
kubectl apply -f deployment.yml
GuestbookApplication.java
- Main Spring Boot applicationGuestbookController.java
- REST endpoints for the guestbook functionalityRedisConfig.java
- Redis configuration for data storage- Static files in
src/main/resources/static
:index.html
- Main UIscript.js
- Client-side JavaScriptstyle.css
- Styling
- View guestbook entries
- Add new entries to the guestbook
- Store entries in Redis
- View environment variables
- Check Redis connection status
Redis connection details can be configured in application.properties
or via environment variables:
REDIS_MASTER_SERVICE_HOST
- Redis hostREDIS_MASTER_SERVICE_PORT
- Redis portREDIS_MASTER_SERVICE_PASSWORD
- Redis password (if required)