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:
@@ -0,0 +1,33 @@
|
||||
# A trivially small HTTP service the app's "downstream" health indicator calls. Scale it to zero to
|
||||
# simulate a dependency outage: kubectl -n demo scale deploy/downstream --replicas=0
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: downstream
|
||||
namespace: demo
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: {app: downstream}
|
||||
template:
|
||||
metadata:
|
||||
labels: {app: downstream}
|
||||
spec:
|
||||
# busybox httpd runs as PID 1 and ignores SIGTERM, so without this a scale-to-zero leaves the
|
||||
# "outage" serving for the full 30 s grace period.
|
||||
terminationGracePeriodSeconds: 2
|
||||
containers:
|
||||
- name: httpd
|
||||
image: busybox:1.37
|
||||
imagePullPolicy: Never
|
||||
command: ["sh", "-c", "mkdir -p /www && echo ok > /www/index.html && exec httpd -f -p 8080 -h /www"]
|
||||
ports: [{containerPort: 8080}]
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: downstream
|
||||
namespace: demo
|
||||
spec:
|
||||
selector: {app: downstream}
|
||||
ports: [{port: 8080, targetPort: 8080}]
|
||||
Reference in New Issue
Block a user