INNER CODE UNIT · Python
main
itbench-hub/ITBench · scenarios/sre/tools/kubernetes-topology-monitor/main.py:50
def main():
args = parse_args()
setup_logging(args.log_level)
try:
k8s_client = K8sClient(kubeconfig_path=args.kubeconfig)
topology = K8sTopologyManager(k8s_client, persistence_dir=args.data_dir)
event_logger = EventLogger(log_dir=args.data_dir)
logger = logging.getLogger("k8s_client")
# Load existing topology if available
latest_snapshot = topology.get_latest_snapshot()
if latest_snapshot:
topology.load_snapshot(latest_snapshot)
else:
# Initial topology build
topology.refresh_topology()
# Start the watcher