Files
mtusi2026lab7/scripts/reload_mesh.py
T

8 lines
507 B
Python

"""Reload HAProxy without replacing shared network namespaces."""
import subprocess,time
for role in ['db','s3','broker','cache','collector','prometheus','loki','tempo','grafana','lb','api','worker','publisher','observer','janitor']:
ids=subprocess.check_output(['./scripts/compose.sh','ps','-q',role],text=True).split()
if ids:subprocess.run(['docker','kill','--signal','USR2',*ids],check=True,stdout=subprocess.DEVNULL)
time.sleep(6)
print('Mesh reloaded; old connections bounded by hard-stop-after5s')