Kubernetes AI Agent
Overview
The Kubernetes AI Agent is the core investigation agent in OpsWorker. It queries your Kubernetes clusters to gather the data needed for root cause analysis — pods, deployments, services, logs, events, and configurations.
This agent is always available when a Kubernetes Agent is installed in the cluster.
Capabilities
Resource Queries
| Resource Type | Operations |
|---|---|
| Pods | List, get status, describe, read logs |
| Deployments | List, get spec, check rollout status |
| Services | List, get spec, check endpoints |
| Ingresses | List, get rules and backends |
| Events | List by namespace, filter by resource |
| ConfigMaps | List, get contents |
| Secrets | List (metadata only — values are not read) |
| Nodes | List, get status and conditions |
| Namespaces | List, get status |
| DaemonSets | List, get status |
| StatefulSets | List, get status |
| ReplicaSets | List, get status |
Log Analysis
- Retrieve recent container logs from pods
- Access logs from previous container instances (after restarts)
- Analyze log content for errors, exceptions, and patterns
Event Timeline
- Query Kubernetes events for specific resources or namespaces
- Sort by timestamp to build an incident timeline
- Identify state transitions (scheduling, pulling, starting, failing)
Endpoint Health
- Check service endpoints for healthy/unhealthy backends
- Verify selector matching between services and pods
- Identify routing issues
How It Works
The Kubernetes AI Agent sends commands to the Kubernetes Agent running in your cluster via SQS:
- AI decides what data it needs (e.g., "get logs for pod X")
- Command is sent to the in-cluster agent
- Agent executes the kubectl-equivalent query
- Results are returned to the AI for analysis
All operations are read-only — the agent never modifies cluster state.
RBAC Scoping
The Kubernetes AI Agent can only access resources that the in-cluster agent's RBAC permissions allow. If the agent is scoped to specific namespaces, the AI Agent is limited to those same namespaces. See Agent RBAC for configuration.
Next Steps
- Git AI Agent — Code change correlation
- Datadog AI Agent — Metric queries
- Agent Scope — Access model details