The Backend of LuckTrainingRoadmaps

Daily Blue-Green Cluster Rotation (Chapter 24i)

Daily Blue-Green Cluster Rotation (Chapter 24i) A workflow diagram generated by Archify. 01 / Green Cluster 02 / Active Traffic 03 / Shared State + Gaps Provision Validate Switch Provision Cluster · create_casino_cluster.sh · Green Cluster › Provision Provision Cluster create_casino_cluster.sh Pre-Switch Validation · 7-check smoke suite · Green Cluster › Validate Pre-Switch Validation 7-check smoke suite Synthetic Transactions · synthetic_tests.py · Green Cluster › Validate Synthetic Transactions synthetic_tests.py Switchover · switchover.sh, 03:00 UTC · Active Traffic › Switch Switchover switchover.sh, 03:00 UTC DNS/HAProxy Cutover · dns_switchover.sh · Active Traffic › Switch DNS/HAProxy Cutover dns_switchover.sh Primary-Writer Lease · wallet_startup.py · Shared State + Gaps › Switch Primary-Writer Lease wallet_startup.py Teardown (Manual) · destroy_cluster.sh missing · Shared State + Gaps › Switch Teardown (Manual) destroy_cluster.sh missing teardown expected 7-check suite passed triggers validation cutover authorized claim + fence lease synthetic tx pass Legend Automation script Health gate Manual / gap Traffic cutover

Nightly Rotation, Not Continuous

  • • A new K3s cluster is provisioned at 02:00 UTC from the IaC baseline
  • • systemd timers separate provision, switchover, and destroy by a deliberate review window
  • • No single command runs the whole rotation end to end

Health Gates Before Traffic Moves

  • • Seven checks: health, wallet API, JWT auth, game listing, Redis balance, WebSocket, TLS expiry
  • • A non-zero exit from pre_switch_validation.sh aborts the switchover
  • • wallet_startup.py fences the primary-writer lease with heartbeat and fail-closed demotion

Known Gaps

  • • chaos_test.sh is deliberately not wired into the unattended nightly path
  • • destroy_cluster.sh is referenced by the driver and the destroy timer but does not exist
  • • rotation-driver.sh destroy fails loudly rather than recording a false successful teardown