The goal is to have a simple app that can be used to demonstrate some features you can use in k8s.
This demo app uses spring boot and a h2-database as technologies.
- endpoint for a health check, which can be controlled via environment variable
- endpoint for a readiness check, which can be controlled via rest endpoint
- background-color and some text customizable via spring config
Run with docker
docker run -p 8080:8080 public.ecr.aws/viadee/k8s-demo-app:latestThen browse to http://localhost:8080
Or build and run with maven locally:
mvn spring-boot:runThis is a simple maven project. Just run maven package.
Or just do a local docker build: docker build -t imagename .
Then you can run the container locally.
mvn clean
mvn native:compile -Pnative
# If "[1/8] Initializing..." fails, it might be due to a lag of resources. Try increasing the VM resources../target/k8s-demo-app
./target/k8s-demo-app --spring.profiles.active=redOverwrite application properties, e.g. via environment variables:
SPRING_DATASOURCE_URL = "jdbc:postgresql://<url_to_postgres_server_instance>:5432/<database_name>"
SPRING_DATASOURCE_DRIVERCLASSNAME = "org.postgresql.Driver"
SPRING_DATASOURCE_USERNAME = <postgres_user>
SPRING_DATASOURCE_PASSWORD = <postgres_password>