A Kubernetes agent that proves its fix

AWS's open-source Strands harness, built into a Kubernetes troubleshooter: one narrow tool, three models with three wrong answers, the instruction that fixed it, and an approval gate.

GazeekSTRANDS HARNESS·EPISODE 1
EPISODE 1

A Kubernetes agent that proves its fix

AWS's open-source Strands harness, built into a Kubernetes troubleshooter: one narrow tool, three models with three wrong answers, the instruction that fixed it, and an approval gate.

0:00 / 5:03

Now try it on a real cluster

The videos are free. Gazeek's hands-on labs give you a real Kubernetes cluster in your browser for every lab, with checks that tell you when you've got it right: the practice the CKA and CKAD exams need.

After this lesson you can

  • Tell the Strands harness from the Strands SDK and the AgentCore harness
  • Build an agent with one narrow tool and the built-in tools switched off
  • Make an agent test its theory before it proposes a fix
  • Put a human approval gate in front of every change
Transcript

A Kubernetes agent that proves its fix

Space Llama here. AWS says its Strands harness gives you a fully assembled AI agent in one call. So I gave it a broken Kubernetes app, and let it fix the thing. Some of it went wrong, and that was the best part.

Three names, one family

First, three names that sound alike. The Strands Agents SDK, the software development kit, is the agent loop and the parts you plug into it: models, tools, hooks, sessions. The Strands harness is that SDK already put together, with benchmarked defaults. One call, create harness, and you get a normal Strands agent back. And the AgentCore harness is something else: a managed AWS service that runs an agent from configuration. Today is about the open-source library you run yourself.

What's in the box

Out of the box, the default model is Claude Opus 5.5 on Amazon Bedrock. Any other model is one argument away. It comes with eight built-in tools: a shell, and reading, writing and editing files. Then web fetch, web search where the model can search, a tool that runs scripts of tool calls, and a helper subagent. Sessions and long-term memory are saved on disk in a folder called dot agent. Large tool output is set aside, so the context window doesn't fill up. And you can add approval gates, though they're off until you do. Those defaults suit a coding agent in your repository. For anything near infrastructure, the first job is to take most of it away.

The patient: a Service that won't answer

Here's the patient. Two nginx pods behind a Service. Both say Running, but zero of one ready, so the Service has no endpoints and answers nobody. There are three faults. The readiness probe checks port 8080, but nginx listens on 80. The probe asks for slash healthz, which stock nginx doesn't serve. And the Service sends traffic to 8080 too.

A read-only agent

The agent gets one tool of my own: kubectl, but only get, describe, logs, events, top and explain. The decorator turns the function into a tool, and the docstring is what the model reads. builtin_tools set to an empty list removes the shell, so this tool is the only way in. The safety is in the code, not in asking the model nicely. Session saving and memory are off, so every run starts fresh and leaves nothing on disk.

Three models, three wrong answers

Our AWS account had no Claude, so I tried the models I could call on Bedrock. Amazon Nova 2 Lite fixed both ports but kept slash healthz. Applied, the probe failed with a 404. MiniMax M2 said to edit the probe on the Pod. But a Deployment replaces its pods, so you change the Deployment. And gpt-oss-120b changed only the Service, and promised the probe would then pass. It wouldn't. Every answer sounded sure of itself. Every one rested on a guess nobody checked.

The fix: make it prove it

So I changed the instructions, not the model. Prove a fix before you propose it. The agent can't run curl in a pod, but it doesn't need to. The Kubernetes API server can proxy a request to a pod's port and path. It changes nothing, though on a real cluster it needs its own permission: get on pods slash proxy. With the same gpt-oss model that had been wrong, it tried slash healthz on port 80, and got not found. It tried slash, got the welcome page, and found all three faults. Twice in a row.

Let it apply, with a person in the way

Last step: let it fix things itself, behind a gate. kubectl apply is a second tool. Human in the loop lets the tools on the allow list run freely, and stops everything else for a yes or no on the terminal. One catch: allow retrieve context too. That's the harness reading back tool output it set aside, and without it, you'll be asked to approve that. gpt-oss sometimes wrote the apply call out as text instead of making it, so for this step I used DeepSeek V4 Flash. It proved all three faults, asked once, and after my yes, applied the fix and checked it. Two of two ready, and the Service answered.

What to take away

Four things. Start by removing the built-in tools you don't need. Put the safety in code and in the cluster's permissions, not in the prompt. Give the agent a way to test its theory. Most wrong answers were confident guesses. And try more than one model. Swapping is one argument, and the differences are big.

The full article, and what's next

The whole worked example, with every line of code, is on the Gazeek blog. The link is below. Next episode: I ran seven models twenty-eight times on this same broken app. Which one should your agent use? See you there.

Hands-on labs

Now try it on a real cluster

A real Kubernetes cluster in your browser for every lab, checked as you go.

See the labs

Read the article

Strands harness, worked example: a Kubernetes agent that proves its fix before you approve it: the whole idea in writing, free.

Read it ↗