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

Resource TypeOperations
PodsList, get status, describe, read logs
DeploymentsList, get spec, check rollout status
ServicesList, get spec, check endpoints
IngressesList, get rules and backends
EventsList by namespace, filter by resource
ConfigMapsList, get contents
SecretsList (metadata only — values are not read)
NodesList, get status and conditions
NamespacesList, get status
DaemonSetsList, get status
StatefulSetsList, get status
ReplicaSetsList, 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:

  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 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