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
10 lines
824 B
Bash
10 lines
824 B
Bash
#!/usr/bin/env bash
|
|
# Run the in-cluster load generator as a pod and wait for it; prints its report.
|
|
# [METHOD=POST] ./scripts/loadgen.sh <name> <url> <concurrency-or-schedule> <seconds>
|
|
set -uo pipefail
|
|
source "$(dirname "$0")/env.sh"
|
|
name="$1" url="$2" conc="$3" secs="$4"
|
|
kubectl -n "$NS" delete pod "$name" --ignore-not-found --wait=true > /dev/null
|
|
kubectl -n "$NS" run "$name" --image="$IMAGE" --image-pull-policy=Never --restart=Never --labels=role=loadgen \
|
|
--overrides='{"spec":{"containers":[{"name":"'"$name"'","image":"'"$IMAGE"'","imagePullPolicy":"Never","resources":{"requests":{"cpu":"100m","memory":"256Mi"},"limits":{"memory":"512Mi"}},"command":["java","-Dloadgen.method='"${METHOD:-GET}"'","-cp","application.jar","com.ankurm.k8s.loadgen.LoadGen","'"$url"'","'"$conc"'","'"$secs"'"]}]}}' > /dev/null
|