- How you use it
- Always on in your project
- What it can do
- writes files
- What's inside
The option
| Option | 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
OOMKilledwith 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 failedand a subsequentKillingevent. The probe guide documents restart behavior and timing controls. Untested experiment: if load makes a healthy process miss the deadline, increasetimeoutSecondsand reviewfailureThresholdagainst 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-secondtimeoutSeconds) 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
Unhealthyevents inkubectl 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, nolatestimage tag, and a non-root securityContext. Then runkubeconform -strict -summary manifest.yamlfor each generated file, substituting its path, and show me the output. Do not runkubectl 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
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.