k8s-health-agent¶
A single agent with tools for monitoring and managing a Kubernetes cluster. Operator-aware: understands workloads managed by Strimzi (kafka.strimzi.io) and ECK (*.k8s.elastic.co) out of the box, and is pluggable for other operators via orrery_core.default_registry.
Core tools¶
| Tool | Description | Guardrail |
|---|---|---|
get_cluster_info | Cluster version, platform, and node count | — |
get_nodes | List nodes with status, roles, capacity, and versions | — |
list_namespaces | List all namespaces and their status | — |
list_pods | List pods with status, readiness, and restart counts | — |
describe_pod | Detailed pod info: containers, conditions, resources | — |
get_pod_logs | Tail pod logs with optional container and time filters | — |
list_deployments | List deployments with replica status and images | — |
get_deployment_status | Detailed rollout status and conditions | — |
get_events | Recent events with optional field selector filter | — |
scale_deployment | Scale a deployment to N replicas | @confirm |
restart_deployment | Trigger a rolling restart | @destructive |
rollback_deployment | Revert to the previous revision | @destructive |
Operator-aware tools¶
These tools use the operator registry in orrery_core to give the agent visibility into CRs managed by installed operators. Strimzi and ECK are built-in; others are registered by calling default_registry.register(...).
| Tool | Description |
|---|---|
detect_operators | List known operators installed in the cluster (scans CRDs) |
list_custom_resources | List any CR (GVR), enriched with healthy / phase / warnings when the operator is known |
describe_custom_resource | Full CR spec + raw status + an interpreted status block |
get_owner_chain | Walk ownerReferences from a Pod up to its root resource |
describe_workload | Pod → operator CR aware: returns the operator's health/phase summary instead of raw pod info |
get_operator_events | Cluster events filtered to operator-watched kinds, optionally narrowed by operator_name |
Example — a failing Kafka broker pod:
describe_pod broker-0 kafka→ showsCrashLoopBackOffon the pod.describe_workload broker-0 kafka→ walksPod → StatefulSet → Kafka, reports "Kafka 'demo' is unhealthy — NotReady: rolling update in progress", and surfaces the operator's.status.conditionsas warnings.
Diagnosis Flow¶
The agent follows this investigation pattern:
detect_operators— learn which operators are installed (run once per session).get_cluster_info+get_nodes— cluster overview.get_events/get_operator_events— recent warnings or errors.- For operator-managed workloads, prefer
describe_workloadordescribe_custom_resourceoverdescribe_pod. get_pod_logs— drill into specific pods once the suspect workload is identified.get_deployment_status— check rollout health for plain Deployments.
Environment Variables¶
Place a .env file in agents/k8s-health/k8s_health_agent/.env:
The agent uses the default kubeconfig (~/.kube/config) or in-cluster config automatically.
See the root README for Google AI / Vertex AI config.
Running¶
Or from the repo root — the orchestrator composes this agent alongside every other specialist, which is how it is meant to be run: