feat:report

This commit is contained in:
Оля Мороз
2026-10-23 18:10:07 +03:00
parent ae53d39ccc
commit f4500589c6
134 changed files with 5282 additions and 237 deletions
+10 -14
View File
@@ -10,26 +10,22 @@ def main():
cfg = json.loads(raw)
services = cfg['services']
for svc in ('api1', 'api2'):
check(svc in services, 'сервис %s отсутствует' % svc)
ports = services[svc].get('ports', [])
check(not ports, '%s публикует порты наружу: %r — должно быть только через LB'
% (svc, ports))
deploy = services[svc].get('deploy', {})
res = deploy.get('resources', {}).get('limits', {})
check('cpus' in res and 'memory' in res,
'%s без deploy.resources.limits cpus/memory: %r' % (svc, res))
check('api' in services, 'сервис api отсутствует')
api = services['api']
check(not api.get('ports'),
'api публикует порты наружу: %r — должно быть только через lb' % api.get('ports'))
deploy = api.get('deploy', {})
res = deploy.get('resources', {}).get('limits', {})
check('cpus' in res and 'memory' in res,
'api без deploy.resources.limits cpus/memory: %r' % res)
check('container_name' not in api,
'api задаёт container_name — ломает deploy.replicas')
check('lb' in services, 'нет сервиса lb')
lb_ports = services['lb'].get('ports', [])
check(any('8080' in str(p) for p in lb_ports),
'lb не публикует 8080: %r' % lb_ports)
check('container_name' not in services.get('api1', {}),
'api1 задаёт container_name — ломает масштабирование')
check('container_name' not in services.get('api2', {}),
'api2 задаёт container_name — ломает масштабирование')
print_pass('limits & topology')