Skip to main content

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

Core resource types are covered by the built-in (legacy) Kubernetes tools. Broader resource types are available through the Kubernetes MCP server, which the agent loads when present. Both are read-only.

Resource TypeOperationsSource
PodsList, get status, describe, read logsBuilt-in tools
ServicesList, get spec, check endpointsBuilt-in tools
IngressesList, get rules and backendsBuilt-in tools
DeploymentsList, get spec, check rollout statusBuilt-in tools
EventsList by namespace, filter by resourceBuilt-in tools
List-allEnumerate resources in a namespaceBuilt-in tools
NodesList, get status and conditionsvia Kubernetes MCP
NamespacesList, get statusvia Kubernetes MCP
DaemonSetsList, get statusvia Kubernetes MCP
StatefulSetsList, get statusvia Kubernetes MCP
ReplicaSetsList, get statusvia Kubernetes MCP
ConfigMapsList, get contentsvia Kubernetes MCP
SecretsList (metadata only, values are not read)via Kubernetes MCP

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:

  1. AI decides what data it needs (e.g., "get logs for pod X")
  2. Command is sent to the in-cluster agent
  3. Agent executes the kubectl-equivalent query
  4. Results are returned to the AI for analysis

All Kubernetes cluster operations are read-only: the agent never applies, deletes, patches, scales, or execs against your cluster. (The only write path anywhere in OpsWorker is Git: the Source Code & Repository Agent can open PRs/MRs, which are always human-reviewed.)

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