This is to record what need to be done on top of a freshly generated Springboot project, in order to:
- Be able to use Makefile to make the commands easier
- Be able to use Containerfile to use docker build and run
- Be able to use yaml to deploy the application into k8s cluster (with kustomize)
- Have a simple RESTful endpoint to return a string as an example
For what can be done with this sample project, just check Makefile
:
- build the application with docker, with JDK (you'll need to install JDK in advance with
make tools
):
make build
- run the application after building:
make up
- test by calling one endpoint:
make curl
Or the above can be done in docker and k8s:
- build the application with docker:
make docker-build
- deploy the application into k8s:
make k8s-up
- test by calling one endpoint:
make k8s-curl
References:
References:
- 使用SLF4J和Logback
- Logging in Spring Boot
- Spring Boot Logging with application.yml
- JSON Logging Best Practices
- Disable Spring Boot Banner at Startup
- How can I change a key name in the JSON output using Logback?
- Logging to Graylog with Spring Boot
- Hibernate: Don’t use show_sql to log SQL queries
References:
- MyBatis with Spring
- 使用IDEA创建SpringBoot+MyBatis+MySql项目实现登录注册功能
- How to solve "Mapper method has an unsupported return type"
References:
- MyBatis Thymeleaf User’s Guide
- Quick Start
- java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class when upgrade from java 11 to 17
References:
References:
- OpenTelemetry Instrumentation for Java
- logback输出json格式日志(包括mdc)发送到kafka
- Using Micrometer to trace your Spring Boot app
- Spring Boot 3 Observability with Grafana
- Observability with Spring Boot 3
- Leveraging OpenTelemetry For Custom Context Propagation
- ADDING HEADERS TO EVERY SPRING BOOT RESPONSE
- Capture tracing header for incoming requests
- Using instrumentation annotations with a Java agent
- Jaeger vs. Helios: Which One Should You Choose?