Реализовать лабораторную 7: mTLS, OpenBao и защита worker

This commit is contained in:
wpyatzy
2026-12-04 20:35:40 +03:00
parent 20afc2c790
commit 1b865eac83
146 changed files with 9552 additions and 87 deletions
+14
View File
@@ -0,0 +1,14 @@
"""Wait for distinct ready replicas through verified HTTPS ingress."""
import argparse,ssl,time,urllib.request
p=argparse.ArgumentParser();p.add_argument('--replicas',type=int,default=2);args=p.parse_args()
ctx=ssl.create_default_context(cafile='.secrets/ca.crt');seen=set()
for attempt in range(120):
try:
with urllib.request.urlopen('https://localhost:8443/health/ready',context=ctx,timeout=4) as r:
if r.status==200:
seen.add(r.headers['X-Instance-Id'])
if len(seen)>=args.replicas:
print(f'HTTPS ready: {len(seen)} distinct replicas; CA and hostname verified');break
except Exception:pass
time.sleep(.5)
else:raise SystemExit('HTTPS replica readiness timeout')