- Implementation
- Metrics
- Tracing
- Swagger
- Docker multistage
- Kubernetes
- manifests
- implementation
- service-discovery
- configmap
- secrets
- Docker
- Minikube / Cloud Kubernetes cluster
- httpie
- jq
-
Locally
mvnw clean spring-boot:run
-
On Docker
docker build . -t server-app-h2:latest docker run -d --name server-app-h2 \ -e SPRING_PROFILES_ACTIVE=docker \ -e HEAP_SIZE=256M \ -e META_SIZE=300M \ -p 8080:8080 -p 8090:8090 \ server-app-h2 docker logs server-app-h2 -f
-
On Kubernetes
kubectl apply -f kube/configmap.yaml kubectl apply -f kube/secret.yaml kubectl apply -f kube/service.yaml kubectl apply -f kube/deployment.yaml kubectl apply -f kube/hor-pod-scale.yaml
- Insert
http POST :8080/users email="[email protected]" name="Matteo Baiguini" age=33 http POST :8080/users email="[email protected]" name="John Doe" age=42 http POST :8080/users email="[email protected]" name="Jane Doe" age=24 http POST :8080/users email="[email protected]" name="Clint Eastwood" age=75
- Get
http :8080/users http :8080/users/[email protected]
- Update
USER_ID=$(http :8080/users/[email protected] | jq ".id") http PUT :8080/users id=$USER_ID email="[email protected]" name="Clint Eastwood" age=89
- Delete
http DELETE :8080/users/[email protected] http DELETE :8080/users
- Prepare env-vars
SERVER_APP_HOST=$(minikube ip) SERVER_APP_PORT=$(k get svc | grep -i server-app | awk '{print $5}' | cut -d ',' -f 1 | sed 's,8080:,,' | sed 's,/TCP,,')
- Insert
http POST $SERVER_APP_HOST:$SERVER_APP_PORT/users email="[email protected]" name="Matteo Baiguini" age=33 http POST $SERVER_APP_HOST:$SERVER_APP_PORT/users email="[email protected]" name="John Doe" age=42 http POST $SERVER_APP_HOST:$SERVER_APP_PORT/users email="[email protected]" name="Jane Doe" age=24 http POST $SERVER_APP_HOST:$SERVER_APP_PORT/users email="[email protected]" name="Clint Eastwood" age=75
- Get
http $SERVER_APP_HOST:$SERVER_APP_PORT/users http $SERVER_APP_HOST:$SERVER_APP_PORT/users/[email protected]
- Update
USER_ID=$(http $SERVER_APP_HOST:$SERVER_APP_PORT/users/[email protected] | jq ".id") http PUT $SERVER_APP_HOST:$SERVER_APP_PORT/users id=$USER_ID email="[email protected]" name="Clint Eastwood" age=89
- Delete
http DELETE $SERVER_APP_HOST:$SERVER_APP_PORT/users/[email protected] http DELETE $SERVER_APP_HOST:$SERVER_APP_PORT/users