FormingRulesclaude-codepublished fresh until

Agent wrote my Kubernetes manifests: what do I check before apply?

Summary As of November 2026, Kubernetes docs name the mistakes that matter in a generated Deployment: a liveness probe that checks the database, no startup probe for slow boots, and memory limits that cause OOMKills. Check schemas offline with local schemas in kubeconform (Apache-2.0), and use server dry-run for what schemas miss.

Not for helm chart linting or templating, writing a Kubernetes operator or CRD, debugging a broken cluster read-only; see write-kubernetes-operator-with-ai-agent-spec-first.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
ARules · v1.0.0+wwfix.1Kubernetes manifests rules (GitHub awesome-copilot)
How you use itAlways on in your project
What it can dowrites files
What's inside
ARules · v1.0.0+wwfix.1Kubernetes manifests rules (GitHub awesome-copilot)
How you use it
Always on in your project
What it can do
writes files
What's inside

What this thread does

The problem

You asked an agent to turn your Dockerfile into Kubernetes YAML (Deployment, Service, maybe Ingress). The file looks plausible, but the usual failures show up after applying it with kubectl apply -f manifest.yaml (requires an existing manifest and cluster access): restart loops, pods never Ready, OOMKilled, or schema errors.

Exit code 137 / CrashLoopBackOff under load

Start with kubectl describe pod <pod>: inspect the affected container's Last State, reason, exit code and Events. The API equivalent is status.containerStatuses[].lastState.terminated; see termination details. Exit code 137 conventionally means SIGKILL (128 + 9), not proof of OOM; see signal exit codes and Linux signal numbers.

  • OOMKilled: the resource guide shows Last State reason OOMKilled with exit code 137. Check for a leak; if usage is expected, consider a higher memory limit and request. Untested experiment: measure peak usage under representative load, then set a memory limit above that peak with headroom that the node can support.
  • Liveness kills: look for Unhealthy / Liveness probe failed and a subsequent Killing event. The probe guide documents restart behavior and timing controls. Untested experiment: if load makes a healthy process miss the deadline, increase timeoutSeconds and review failureThreshold against measured response times; use a startup probe for slow boot. Readiness failure alone does not restart a container.
  • Node pressure: check eviction messages and node conditions such as MemoryPressure. Node-pressure eviction is a separate diagnosis; pressure can also invoke the OOM killer before eviction reacts.

Do not infer the cause from 137 or CrashLoopBackOff alone, raise memory limits to cure probe failures, or disable liveness merely to hide restarts. Match the change to the termination reason and events.

What the official docs say

Probes. The probe guide separates three jobs: liveness failure restarts the container, readiness failure removes the pod from the Service without restarting, and a startup probe holds the other two off until a slow app has booted. Failure modes to look for in a generated file:

  • A liveness check that depends on the database or another service. If a dependency outage makes each pod’s liveness probe fail its configured threshold, the affected containers restart according to their restart policy. Keep liveness local to the process; put dependency checks in readiness.
  • Without a startup probe or sufficient liveness startup allowance, a slow-starting container can fail liveness and restart before becoming healthy.
  • Very tight timing (failureThreshold: 1, 1-second timeoutSeconds) that turns a pause into a restart.
  • A readiness probe that repeatedly fails because its port or path is wrong keeps the container unready. Check the Unhealthy events in kubectl describe pod <pod>.

Resources. The resource management page says requests are what the scheduler reserves and limits are the cap. A CPU limit throttles; a memory limit is enforced by the kernel with an OOM kill (shows as OOMKilled). If a resource limit is set without a request, Kubernetes copies the limit to the request unless an admission-time mechanism has already supplied a default request. Placement uses requests, not actual usage.

Validation. kubeconform (Apache-2.0) checks manifests against the Kubernetes OpenAPI schemas without a cluster: kubeconform -strict -summary manifest.yaml, with -kubernetes-version to pin your cluster version. Custom resources need an extra schema location. Its README says server-side validations are not covered. Use a server dry run with an existing manifest and cluster access; see the apply reference:

kubectl apply --dry-run=server -f manifest.yaml

How to describe it to your agent

Write Kubernetes manifests for the app in this Dockerfile. Requirements: a startupProbe, a livenessProbe that only checks the process (no database calls), a readinessProbe that may check dependencies, resource requests and limits with a memory limit above the observed peak, no latest image tag, and a non-root securityContext. Then run kubeconform -strict -summary manifest.yaml for each generated file, substituting its path, and show me the output. Do not run kubectl apply -f manifest.yaml.

Mistakes to check

  • Copying one endpoint into all three probes without checking that it implements the required startup, liveness and readiness semantics.
  • Setting memory limits from a guess instead of measured usage.
  • Trusting a green schema check as proof the app will start.

Limits

A community thread on this topic (r/kubernetes) shows the pain is real but the real problem there was matching your organisation's standards, which no schema checker knows.

Started from a post by @Kubernetes documentation, packaged by the editor. Original post

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Agent wrote my Kubernetes manifests: what do I check before apply?
Summary: As of November 2026, Kubernetes docs name the mistakes that matter in a generated Deployment: a liveness probe that checks the database, no startup probe for slow boots, and memory limits that cause OOMKills. Check schemas offline with local schemas in kubeconform (Apache-2.0), and use server dry-run for what schemas miss.

## Options
- A · Kubernetes manifests rules (GitHub awesome-copilot) · early, no verdict yet · writes files
Copy for agent
get the whatworks thread agent-written-kubernetes-manifests-probes-limits-kubeconform and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread agent-written-kubernetes-manifests-probes-limits-kubeconform

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · Kubernetes manifests rules (GitHub awesome-copilot)

A 4.5 KB rules file for agents writing Kubernetes YAML: recommended labels, securityContext defaults, resource requests and limits, liveness and readiness probes, and validation commands (kubectl dry-run, kubeconform -strict). Not for: non-Kubernetes infra or Terraform (use check-agent-written-terraform-for-insecure-config-while-it-writes); a style baseline, not a security scan.

Format
Rules
Source
github:github/awesome-copilot#instructions/kubernetes-manifests.instructions.md
Pinned
v1.0.0+wwfix.1 · cb64ad12e327
Content hash
cb64ad12e32737ae
Audit
scan passed
Can do
writes files
Works with
claude-code
Check
Rules are at the Claude Code rules path; Copilot applyTo frontmatter is removed.; Security guidance and validation examples survived the copy; no cluster command runs.
Author
@github
Kudos
0
Are you @github? Sign in with GitHub to claim it.
Ask your agent
show me the whatworks package kubernetes-manifests-rules before installing

A · Files

Read from the package source at the pinned version. Shown as is; nothing here runs.

Loading files…

Ask your agent
show me the files of the whatworks package kubernetes-manifests-rules
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp