added probes for RabbitMQ with graceful shutdown#75
added probes for RabbitMQ with graceful shutdown#75henzigo wants to merge 1 commit intojg/redis-orderfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the RabbitMQ StatefulSet manifests to include Kubernetes health probes and a graceful shutdown hook, and refreshes scenario snapshots and upgrade notes accordingly.
Changes:
- Add
startupProbe,livenessProbe, andreadinessProbeto RabbitMQ. - Add
preStoplifecycle hook,terminationGracePeriodSeconds, and memory requests/limits for RabbitMQ. - Update RabbitMQ container ports and StatefulSet
updateStrategy, and refresh expected YAML outputs + UPGRADE notes.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| kubernetes/deployments/rabbitmq.yaml | Adds probes, graceful shutdown hook, resource memory settings, ports, and update strategy to the RabbitMQ StatefulSet template. |
| UPGRADE.md | Documents the RabbitMQ probes/graceful shutdown change for v5.1.0. |
| tests/scenarios/basic-production/expected/migrate-first-deploy.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/basic-production/expected/migrate-first-deploy-with-demo-data.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/development-single-domain/expected/migrate-first-deploy.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/development-single-domain/expected/migrate-first-deploy-with-demo-data.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/development-single-domain/expected/migrate-continuous-deploy.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/escaping-env/expected/migrate-first-deploy-with-demo-data.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy-with-demo-data.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
| tests/scenarios/production-with-cloudflare/expected/migrate-continuous-deploy.yaml | Updates expected rendered manifests to include new RabbitMQ probes/shutdown/resources/ports/strategy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| lifecycle: | ||
| preStop: | ||
| exec: | ||
| command: [ "sh", "-c", "rabbitmqctl stop_app && sleep 5" ] |
There was a problem hiding this comment.
preStop uses rabbitmqctl stop_app && sleep 5, so if stop_app exits non-zero (e.g., node already stopping / CLI can't connect), the sleep won’t run and the hook won’t provide the intended drain delay. Consider making the hook resilient (e.g., run stop_app best-effort and always sleep).
| command: [ "sh", "-c", "rabbitmqctl stop_app && sleep 5" ] | |
| command: [ "sh", "-c", "rabbitmqctl stop_app || true; sleep 5" ] |
| exec: | ||
| command: [ "rabbitmq-diagnostics", "ping" ] | ||
| failureThreshold: 30 | ||
| periodSeconds: 10 |
There was a problem hiding this comment.
startupProbe doesn’t set timeoutSeconds, so it defaults to 1s; exec probes can easily exceed that under load (especially during cold start), causing unnecessary restarts. Set an explicit timeoutSeconds (typically matching liveness/readiness) to avoid flaky startups.
| periodSeconds: 10 | |
| periodSeconds: 10 | |
| timeoutSeconds: 15 |
No description provided.