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
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
# The baseline Deployment every scenario starts from. Scenario scripts patch it with the specific
|
|
# change under test (see scripts/*.sh), so each transcript differs from this file in one place.
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: orders
|
|
namespace: demo
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels: {app: orders}
|
|
template:
|
|
metadata:
|
|
labels: {app: orders}
|
|
spec:
|
|
terminationGracePeriodSeconds: 30
|
|
containers:
|
|
- name: app
|
|
image: sbd/k8s-demo:1
|
|
imagePullPolicy: Never
|
|
ports: [{name: http, containerPort: 8080}]
|
|
env:
|
|
- name: DEMO_DOWNSTREAM_URL
|
|
value: http://downstream:8080/
|
|
- name: JAVA_TOOL_OPTIONS
|
|
value: "-XX:MaxRAMPercentage=75"
|
|
resources:
|
|
requests: {cpu: 250m, memory: 512Mi}
|
|
limits: {memory: 512Mi}
|
|
startupProbe:
|
|
httpGet: {path: /actuator/health/liveness, port: http}
|
|
periodSeconds: 2
|
|
failureThreshold: 60
|
|
livenessProbe:
|
|
httpGet: {path: /actuator/health/liveness, port: http}
|
|
periodSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet: {path: /actuator/health/readiness, port: http}
|
|
periodSeconds: 2
|
|
failureThreshold: 1
|
|
lifecycle:
|
|
preStop:
|
|
sleep: {seconds: 5}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: orders
|
|
namespace: demo
|
|
labels: {app: orders}
|
|
spec:
|
|
selector: {app: orders}
|
|
ports: [{name: http, port: 8080, targetPort: http}]
|