---
title: "Pod Troubleshooting with AI Agent in Your K8s Cluster | Lens — Lens"
description: "CrashLoopBackOff, OOMKilled or Pending? Right-click the pod and Lens K8S IDE launches Claude Code, Codex CLI or Gemini CLI with your cluster context attached."
url: https://lenshq.io/use-cases/ask-ai/
---

Ask AI

# Your pod or deployment fails?

Troubleshoot any Kubernetes resource with AI in a single click.

[Start your free trial](https://lenshq.io/download/)

![Lens K8S IDE with the Ask AI pane open on the fases-aks cluster. The prompt asks for the root cause of the failing broken-demo deployment and a one-line fix. Claude Code answers from the cluster: the deployment references the image tag nginx:no-such-tag-9999, which does not exist on Docker Hub, so the pod is stuck in ImagePullBackOff, and gives the fix, kubectl set image deployment/broken-demo nginx=nginx:1.27](https://lenshq.io/images/use-cases/ask-ai-troubleshoot.webp)

How Lens resolves it

## Context attached, not pasted

The feature is called Ask AI. Lens points KUBECONFIG at the cluster you have open and puts a matching kubectl on the PATH, so the agent reads the pod itself.

![The context menu on a pod row in Lens K8S IDE, with an Ask Claude Code entry open on a submenu of Summarize, Analyze events, Analyze metrics, Analyze logs and Analyze related resources](https://lenshq.io/images/use-cases/ask-ai-pod-menu.webp)

### Pick your agent

Claude Code, Copilot CLI, Gemini CLI, Codex CLI or OpenCode.

### Right-click any resource

Summarize it, or analyze its logs, events and metrics.

### Answers that click back

Resources come back as Lens links. Ask AI is Premium.

Why it works

## No pasting, no API key

Any agent

Five presets, or your own command

[Lens documentation, Configure Ask AI](https://docs.lenshq.io/k8slens/ask-ai/configure-ask-ai/)

No API key

AI provider to configure in Lens

[Lens release notes, June 2026](https://lenshq.io/blog/lens-release-june-26/)

All resources

Right-click to investigate any

[Lens documentation, Using Ask AI](https://docs.lenshq.io/k8slens/ask-ai/using-ask-ai/)

Free. No payment details needed.

## Try Ask AI in the Lens 14-day trial

Every premium feature, unlocked for 14 days.

![Amazon Web Services](https://lenshq.io/images/brands/aws.svg)

### AWS EKS

Discover EKS clusters across your AWS accounts.

[Read the docs](https://docs.lenshq.io/k8slens/getting-started/add-clusters/add-aws-eks/)

![Microsoft Azure](https://lenshq.io/images/brands/azure.svg)

### Azure AKS

Discover AKS clusters across your Azure subscriptions.

[Read the docs](https://docs.lenshq.io/k8slens/getting-started/add-clusters/add-azure-aks/)

### Ask AI

Connect your own AI CLI to any Kubernetes object, with live cluster context.

[Read the docs](https://docs.lenshq.io/k8slens/ask-ai/)

### Lens MCP Server

Reach every cluster Lens knows from Claude, Codex or any MCP client.

[Read the docs](https://docs.lenshq.io/k8slens/mcp-server/)

![Argo CD](https://lenshq.io/images/brands/argo.svg)

### Argo CD

Sync and health for every Application, next to its pods.

[Read the docs](https://docs.lenshq.io/k8slens/argo-cd/)

![Flux](https://lenshq.io/images/brands/flux.svg)

### Flux CD

Reconciliation, drift and failures across every Flux resource.

[Read the docs](https://docs.lenshq.io/k8slens/flux-cd/)

### Security Center

Scan the images your cluster runs for CVEs and exposed secrets.

[Read the docs](https://docs.lenshq.io/k8slens/security-center/)

### Hotbar

Quick access to the clusters you open most.

[Read the docs](https://docs.lenshq.io/k8slens/using-lens/hotbar/)

### Advanced editor

Edit a live resource in diff mode, and revert in one click.

[Read the docs](https://docs.lenshq.io/k8slens/using-lens/advanced-editor/)

Download Lens Desktop and create your Lens ID from the app. Your 14 days start there. When the trial ends, your configuration is kept and the features lock until you upgrade.

[See plans](https://lenshq.io/pricing/) [Start your free trial](https://lenshq.io/download/)
