Add kubernetes-deployment: probes, shutdown, JVM ergonomics, HPA

Companion code for "Deploying Spring Boot 4 on Kubernetes: Probes, Graceful
Shutdown, Limits and JVM Ergonomics". A dependency outage under three
probe-group setups, a rolling restart under load four ways (three runs
each), the JVM's ergonomic choices for nine pod shapes, one GC-heavy load
under five CPU limits with throttling counters, and an HPA driven by a
Micrometer gauge through prometheus-adapter. Measured on k3s v1.36.4.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01C3TETMrqVUWeFkNtz3Jbo3
This commit is contained in:
2026-09-11 17:12:10 +00:00
co-authored by Claude Opus 5
parent 644da9e65e
commit a065696478
72 changed files with 28415 additions and 2 deletions
+20
View File
@@ -0,0 +1,20 @@
# Scale orders on in-flight requests per pod, not CPU. Target: 5 in flight on average.
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata: {name: orders, namespace: demo}
spec:
scaleTargetRef: {apiVersion: apps/v1, kind: Deployment, name: orders}
minReplicas: 1
maxReplicas: 4
metrics:
- type: Pods
pods:
metric: {name: app_inflight_requests}
target: {type: AverageValue, averageValue: "5"}
behavior:
scaleUp:
stabilizationWindowSeconds: 0
scaleDown:
# The default is 300 s. Shortened so the demo shows a scale-down inside a few minutes;
# keep the default (or longer) in production.
stabilizationWindowSeconds: 30