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
39 lines
982 B
YAML
39 lines
982 B
YAML
# One replica used only by the CPU-limit / GC experiment. scripts/demo-gc-throttling.sh patches
|
|
# resources and JAVA_TOOL_OPTIONS per variant.
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: gc-lab
|
|
namespace: demo
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels: {app: gc-lab}
|
|
template:
|
|
metadata:
|
|
labels: {app: gc-lab}
|
|
spec:
|
|
containers:
|
|
- name: app
|
|
image: sbd/k8s-demo:1
|
|
imagePullPolicy: Never
|
|
ports: [{name: http, containerPort: 8080}]
|
|
env:
|
|
- name: JAVA_TOOL_OPTIONS
|
|
value: ""
|
|
resources:
|
|
requests: {cpu: 100m, memory: 256Mi}
|
|
limits: {cpu: "1", memory: 1Gi}
|
|
readinessProbe:
|
|
httpGet: {path: /actuator/health/readiness, port: http}
|
|
periodSeconds: 2
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: gc-lab
|
|
namespace: demo
|
|
spec:
|
|
selector: {app: gc-lab}
|
|
ports: [{name: http, port: 8080, targetPort: http}]
|