feat(ai-sre): add 7 agent tools — restart/scale/delete/cordon/describe + parallel log analysis - #15
Merged
Merged
Conversation
runbook_tools.py: - restart_deployment: kubectl rollout restart deployment/X -n Y (safe, no downtime) - scale_deployment: kubectl scale deployment/X --replicas=N (clamped 0-50) - delete_stuck_pod: kubectl delete pod X [--force --grace-period=0] for stuck pods - cordon_node / uncordon_node: prevent scheduling on pressured nodes - describe_cluster_resource: kubectl describe on pod/deployment/node/service/pvc/etc log_tools.py: - analyze_logs_for_namespace: parallel log analysis across all running pods in namespace, returns aggregated error counts, categories, worst offender agents.py: - log_agent: +analyze_logs_for_namespace - infra_agent: +describe_cluster_resource - runbook_agent: +restart_deployment +scale_deployment +delete_stuck_pod +cordon_node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runbook_agentandinfra_agentlog_agentagents.pyNew tools
runbook_tools.py
restart_deployment(name, namespace)—kubectl rollout restart, safe/no-downtimescale_deployment(name, replicas, namespace)— clamped 0–50delete_stuck_pod(name, namespace, force)— optional--grace-period=0cordon_node(name, uncordon)— prevent/re-enable schedulingdescribe_cluster_resource(type, name, namespace)— safe allowlist: pod/deployment/node/service/pvc/replicaset/statefulset/daemonset/joblog_tools.py
analyze_logs_for_namespace(namespace, max_pods)— parallel log analysis viaThreadPoolExecutor(max_workers=5), returns aggregated error counts, category breakdown, worst offender podAgent wiring
log_agent←analyze_logs_for_namespaceinfra_agent←describe_cluster_resourcerunbook_agent←restart_deployment,scale_deployment,delete_stuck_pod,cordon_nodeTest plan
analyze_logs_for_namespacereturnspod_breakdownsorted by error_countrestart_deploymentblocked whenDRY_RUN=truein configdescribe_cluster_resourcerejects invalidresource_typewith error JSON