Review Kubernetes Manifests
Purpose
Make a workload safe to run in production: correctly sized, observable by the scheduler, hardened, resilient to node and zone loss, and consistent across environments.
When to use
- Manifests, a Helm chart or rendered Kustomize output are shared for review.
- Pods are OOMKilled, throttled, evicted or restart-looping.
- A workload is being onboarded to a production or shared cluster.
When not to use
- The container image itself is the concern. Use
dockerfile-review.
- The cloud/cluster infrastructure code is the concern. Use
iac-review.
- The question is how many replicas or nodes are needed long term. Use
capacity-planning.
Inputs
Required:
- The manifest YAML (or rendered chart output).
Optional, improves quality:
- Workload profile: stateless/stateful, traffic, latency SLO, startup time, memory behavior.
- Cluster policies (admission controllers, Pod Security Standards level, network policy default, service mesh).
- Observed metrics or incidents (OOMKills, throttling, restarts).
If the YAML is missing, ask for it. If a chart is given unrendered, review values and templates and state the assumptions.
Process
- Inventory objects and their relations (Deployment/StatefulSet/Job, Service, Ingress/Gateway, ConfigMap, Secret, HPA, PDB, NetworkPolicy, ServiceAccount).
- Resources: requests set for CPU and memory on every container; memory limit set; CPU limit only if the organization requires it (note throttling risk); requests grounded in measured usage or marked
[ASSUMPTION].
- Probes: readiness reflects ability to serve; liveness checks only the process, not dependencies; startup probe for slow starters; sensible timeouts and thresholds.
- Security:
runAsNonRoot, fixed UID, allowPrivilegeEscalation: false, drop all capabilities, readOnlyRootFilesystem, seccomp RuntimeDefault, no hostPath/hostNetwork, dedicated ServiceAccount with automount disabled unless needed, least-privilege RBAC. Compare with Pod Security Standards "restricted".
- Availability: replicas at least 2 for serving workloads, PodDisruptionBudget, topology spread or anti-affinity across nodes/zones, rolling update surge/unavailable settings, graceful shutdown (
terminationGracePeriodSeconds, preStop, connection draining).
- Scaling: HPA metrics and bounds consistent with requests; no conflict between HPA and fixed replicas in GitOps.
- Configuration and secrets: no secrets in ConfigMaps or env literals; image referenced by immutable tag or digest;
imagePullPolicy sensible; environment differences only via values/overlays.
- Networking: NetworkPolicy default deny with explicit allows; Service ports and selectors match; ingress TLS.
- Operability: labels (app, version, team), annotations for metrics scraping, log to stdout, resource names consistent.
- Rate findings and give corrected YAML snippets.
- Label every inference
[ASSUMPTION] and move unsupported items to open questions. If the goal continues, suggest capacity-planning for requests and replica sizing, resilience-review for failure modes, or deployment-strategy for the rollout.
Output format
# Kubernetes Manifest Review: <workload>
Summary: <production readiness verdict: Ready / Ready with fixes / Not ready>
| # | Severity | Object | Field | Finding | Fix |
## Corrected Snippets
## Assumptions and Open Questions
Quality checklist
Common pitfalls
- Liveness probe calling the database: a database blip restarts every pod. Keep liveness local.
- Copying request values from another service. Base them on observed usage and revisit.
- PDB with
minAvailable equal to replicas, which blocks node drains. Allow at least one disruption.
Example
Input: Deployment with 1 replica, no resources, liveness GET /health that checks database, runs as root.
Excerpt of output:
| # |
Severity |
Object |
Field |
Finding |
Fix |
| 1 |
High |
Deployment |
replicas |
Single replica, no PDB |
3 replicas, PDB maxUnavailable: 1, zone spread |
| 2 |
High |
Deployment |
livenessProbe |
Checks database; cascading restarts |
Liveness /livez (process only), readiness /readyz |
| 3 |
High |
Deployment |
securityContext |
Runs as root |
runAsNonRoot: true, drop ALL, read-only root FS |
1---2name: kubernetes-manifest-review3description: "Reviews Kubernetes manifests, Helm charts or Kustomize output for resource requests and limits, health probes, security context, availability (replicas, disruption budgets, spread), configuration and secret handling, and operability. Returns prioritized findings with corrected YAML. Use when manifests are submitted for review, pods restart or get evicted, or a workload is being prepared for production."4license: MIT5metadata:6 source: https://skillmd.com/skills/muratdincer/kubernetes-manifest-review7 version: "1.0.0"8 language: en9 category: 07-devops-sre10 role: devops-engineer11 area: infrastructure12 title: "Review Kubernetes manifests"13 related: "dockerfile-review, secrets-management-plan, capacity-planning, deployment-strategy, resilience-review"14 prompt: "Review this Deployment and Service YAML for our order API before we go live on the production cluster."15---1617# Review Kubernetes Manifests1819## Purpose20Make a workload safe to run in production: correctly sized, observable by the scheduler, hardened, resilient to node and zone loss, and consistent across environments.2122## When to use23- Manifests, a Helm chart or rendered Kustomize output are shared for review.24- Pods are OOMKilled, throttled, evicted or restart-looping.25- A workload is being onboarded to a production or shared cluster.2627## When not to use28- The container image itself is the concern. Use `dockerfile-review`.29- The cloud/cluster infrastructure code is the concern. Use `iac-review`.30- The question is how many replicas or nodes are needed long term. Use `capacity-planning`.3132## Inputs33Required:34- The manifest YAML (or rendered chart output).3536Optional, improves quality:37- Workload profile: stateless/stateful, traffic, latency SLO, startup time, memory behavior.38- Cluster policies (admission controllers, Pod Security Standards level, network policy default, service mesh).39- Observed metrics or incidents (OOMKills, throttling, restarts).4041If the YAML is missing, ask for it. If a chart is given unrendered, review values and templates and state the assumptions.4243## Process441. Inventory objects and their relations (Deployment/StatefulSet/Job, Service, Ingress/Gateway, ConfigMap, Secret, HPA, PDB, NetworkPolicy, ServiceAccount).452. Resources: requests set for CPU and memory on every container; memory limit set; CPU limit only if the organization requires it (note throttling risk); requests grounded in measured usage or marked `[ASSUMPTION]`.463. Probes: readiness reflects ability to serve; liveness checks only the process, not dependencies; startup probe for slow starters; sensible timeouts and thresholds.474. Security: `runAsNonRoot`, fixed UID, `allowPrivilegeEscalation: false`, drop all capabilities, `readOnlyRootFilesystem`, seccomp `RuntimeDefault`, no hostPath/hostNetwork, dedicated ServiceAccount with automount disabled unless needed, least-privilege RBAC. Compare with Pod Security Standards "restricted".485. Availability: replicas at least 2 for serving workloads, PodDisruptionBudget, topology spread or anti-affinity across nodes/zones, rolling update surge/unavailable settings, graceful shutdown (`terminationGracePeriodSeconds`, preStop, connection draining).496. Scaling: HPA metrics and bounds consistent with requests; no conflict between HPA and fixed replicas in GitOps.507. Configuration and secrets: no secrets in ConfigMaps or env literals; image referenced by immutable tag or digest; `imagePullPolicy` sensible; environment differences only via values/overlays.518. Networking: NetworkPolicy default deny with explicit allows; Service ports and selectors match; ingress TLS.529. Operability: labels (app, version, team), annotations for metrics scraping, log to stdout, resource names consistent.5310. Rate findings and give corrected YAML snippets.5411. Label every inference `[ASSUMPTION]` and move unsupported items to open questions. If the goal continues, suggest `capacity-planning` for requests and replica sizing, `resilience-review` for failure modes, or `deployment-strategy` for the rollout.5556## Output format57```markdown58# Kubernetes Manifest Review: <workload>59Summary: <production readiness verdict: Ready / Ready with fixes / Not ready>60| # | Severity | Object | Field | Finding | Fix |61## Corrected Snippets62## Assumptions and Open Questions63```6465## Quality checklist66- [ ] Every container has requests; memory limits are present.67- [ ] Liveness probes do not depend on downstream services.68- [ ] Security context meets the restricted baseline or deviations are justified.69- [ ] Serving workloads survive a single node drain (replicas, PDB, spread).70- [ ] Suggested values not backed by data are marked `[ASSUMPTION]`.71- [ ] All checks pass; if any fails, revise the output and re-run this checklist before answering.7273## Common pitfalls74- Liveness probe calling the database: a database blip restarts every pod. Keep liveness local.75- Copying request values from another service. Base them on observed usage and revisit.76- PDB with `minAvailable` equal to replicas, which blocks node drains. Allow at least one disruption.7778## Example79Input: Deployment with 1 replica, no resources, liveness `GET /health` that checks database, runs as root.8081Excerpt of output:82| # | Severity | Object | Field | Finding | Fix |83|---|---|---|---|---|---|84| 1 | High | Deployment | replicas | Single replica, no PDB | 3 replicas, PDB `maxUnavailable: 1`, zone spread |85| 2 | High | Deployment | livenessProbe | Checks database; cascading restarts | Liveness `/livez` (process only), readiness `/readyz` |86| 3 | High | Deployment | securityContext | Runs as root | `runAsNonRoot: true`, drop ALL, read-only root FS |