Inferensys

Prompt

Pod Resource Limit and Request Change Review Prompt

A practical prompt playbook for platform engineers to review container resource configuration changes, analyzing OOM risk, scheduling impact, cost implications, and QoS class changes before deployment.
Risk analyst performing AI risk assessment on laptop, risk matrices visible, casual office risk session.
PROMPT PLAYBOOK

When to Use This Prompt

Understand the ideal conditions, required inputs, and limitations for reviewing Kubernetes pod resource changes before production.

This prompt is designed for platform engineers and SRE teams who need to review Kubernetes pod resource configuration changes before they reach production. It ingests a diff of CPU and memory request/limit modifications and produces a structured stability assessment that covers OOM kill risk, scheduling failure probability, cost impact, and Quality of Service (QoS) class transitions. Use this prompt in CI/CD pipelines, PR review workflows, or pre-deployment checklists where resource misconfiguration is a leading cause of node pressure, evictions, and unexpected cloud spend.

The prompt assumes you have a before-and-after resource specification, namespace context, and node pool information available. It does not replace load testing or live profiling, but it catches the configuration errors that cause incidents before they ship. Required inputs include the full resource diff showing old and new request/limit values, the target namespace, available node pool capacity ranges, and any organizational resource policies such as maximum allowed memory limits or required QoS tiers. Without node pool context, the prompt cannot accurately assess scheduling risk. Without namespace information, it cannot evaluate whether the change violates namespace-level resource quotas or budget constraints.

Do not use this prompt for evaluating application performance under load, diagnosing memory leaks, or tuning JVM garbage collection parameters. It is not a substitute for vertical pod autoscaling recommendations based on historical metrics. The prompt focuses exclusively on static configuration correctness: will this pod schedule, will it get evicted under memory pressure, will its QoS class change unexpectedly, and what is the cost direction of the change. For runtime behavior analysis, pair this prompt with live profiling data and load test results. For cost optimization recommendations based on actual utilization, use a separate rightsizing prompt that ingests Prometheus or Datadog metrics.

This prompt works best when integrated into a PR review workflow where every resource change triggers an automated assessment. Configure your CI pipeline to extract the resource diff from Helm values files, Kustomize overlays, or raw manifest changes, then pass the structured diff to the prompt along with node pool metadata from your cluster inventory. The prompt's structured output can be posted as a PR comment, used to block merges that introduce Burstable-to-BestEffort regressions, or routed to a human reviewer when the risk score exceeds a threshold. Always require human approval for changes that remove memory limits entirely or that reduce requests below 50% of historical usage without documented justification.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Pod Resource Limit and Request Change Review Prompt delivers reliable, structured analysis—and where it introduces operational risk if applied without the right inputs and human oversight.

01

Good Fit: Pre-Merge Resource Review

Use when: A platform engineer opens a PR that modifies CPU or memory requests/limits in a Kubernetes manifest. The prompt maps each change to QoS class impact, OOM risk, and scheduling behavior. Guardrail: Always pair the prompt output with a cluster capacity check; the model cannot see actual node utilization.

02

Bad Fit: Live Cluster Tuning

Avoid when: You need real-time resource recommendations based on live metrics, HPA status, or node pressure. The prompt analyzes static configuration, not dynamic cluster state. Guardrail: Use this prompt for change review, not for autoscaling decisions. Pipe live metrics to a separate monitoring workflow.

03

Required Inputs

What you must provide: A complete diff of the resource configuration change, the workload type (Deployment, StatefulSet, etc.), the target namespace, and any relevant QoS or budget policies. Guardrail: Missing namespace context leads to incorrect scheduling assumptions. Validate the diff includes both old and new values before calling the prompt.

04

Operational Risk: Silent QoS Downgrades

What to watch: A change that removes only the CPU limit while keeping the request can silently reclassify a pod from Guaranteed to Burstable QoS, increasing eviction risk under node pressure. Guardrail: Require the prompt output to explicitly state the before-and-after QoS class. Add a CI check that blocks QoS downgrades without explicit approval.

05

Operational Risk: Cost Blast Radius

What to watch: A small request increase in a high-replica-count Deployment can multiply into a significant cluster cost change that the diff alone doesn't surface. Guardrail: Extend the prompt to calculate the total resource delta (delta Ă— replicas) and flag any change exceeding a configurable cost threshold for additional review.

06

When to Escalate to a Human

What to watch: The prompt identifies a change that reduces the memory limit below observed historical usage or removes a limit entirely on a production workload. Guardrail: Configure the review pipeline to require manual approval when the prompt flags OOM risk or limit removal on namespaces tagged as production. Never auto-merge these changes.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt for analyzing Kubernetes pod resource limit and request changes with structured risk assessment.

This prompt template is designed to be pasted directly into your AI workflow, whether that's a chat interface, an API call, or an automated CI/CD pipeline. It expects a structured diff of Kubernetes resource configuration changes and produces a standardized risk assessment. Before using it, you must replace every square-bracket placeholder with concrete values. The prompt is self-contained; it includes the role, the task, the required output schema, and evaluation criteria so that the model has everything it needs to produce a consistent, machine-readable result.

code
You are a senior platform engineer reviewing a Kubernetes pod resource configuration change. Your task is to analyze the provided diff and produce a structured risk assessment.

[INPUT]
### Resource Configuration Diff:
[diff]

### Target Environment:
[ENVIRONMENT]

### Affected Workload Name:
[WORKLOAD_NAME]

### Cluster Node Capacity (optional):
[NODE_CAPACITY]

[OUTPUT_SCHEMA]
You must respond with a single JSON object conforming to this schema:
{
  "change_summary": "string (brief description of the change)",
  "qos_class_change": {
    "previous": "string (Guaranteed | Burstable | BestEffort)",
    "proposed": "string (Guaranteed | Burstable | BestEffort)",
    "risk": "string (none | low | medium | high)"
  },
  "oom_risk": {
    "level": "string (none | low | medium | high | critical)",
    "rationale": "string (explanation based on memory limit vs. request delta and typical usage)"
  },
  "scheduling_risk": {
    "level": "string (none | low | medium | high | critical)",
    "rationale": "string (explanation based on request size vs. available node capacity)"
  },
  "cost_impact": {
    "direction": "string (increase | decrease | neutral)",
    "estimated_magnitude": "string (minimal | moderate | significant)",
    "rationale": "string"
  },
  "findings": [
    {
      "severity": "string (low | medium | high | critical)",
      "category": "string (oom_risk | scheduling | cost | qos | best_practice)",
      "description": "string",
      "recommendation": "string"
    }
  ],
  "overall_verdict": "string (approved | approved_with_comments | needs_review | blocked)"
}

[CONSTRAINTS]
- If the diff sets memory limits without setting memory requests, flag a high-severity best_practice finding.
- If the proposed QoS class is BestEffort for a production workload, the overall_verdict must be "needs_review" or "blocked."
- If CPU limits are removed while requests remain, note the trade-off between throttling risk and cost.
- Do not invent node capacity if [NODE_CAPACITY] is not provided; state that scheduling risk is assessed without full node data.
- Base all rationale on the provided diff, not on assumptions about the application.

[EXAMPLES]
Example Input:
  diff: "- resources: {}\n+ resources:\n+   requests:\n+     memory: \"128Mi\"\n+     cpu: \"100m\"\n+   limits:\n+     memory: \"256Mi\""
  environment: "production"
  workload_name: "payment-processor"

Example Output:
{
  "change_summary": "Added resource requests and limits to a previously unconstrained container.",
  "qos_class_change": {
    "previous": "BestEffort",
    "proposed": "Burstable",
    "risk": "none"
  },
  "oom_risk": {
    "level": "low",
    "rationale": "Memory limit is set to 256Mi, which provides a clear boundary. Risk is low assuming the application operates within this range."
  },
  "scheduling_risk": {
    "level": "low",
    "rationale": "Requests are modest (128Mi memory, 100m CPU). Scheduling risk is low on typical nodes."
  },
  "cost_impact": {
    "direction": "increase",
    "estimated_magnitude": "minimal",
    "rationale": "Moving from BestEffort to Burstable with small requests will have a minimal cost increase."
  },
  "findings": [
    {
      "severity": "medium",
      "category": "best_practice",
      "description": "Container previously had no resource constraints, risking node stability.",
      "recommendation": "Monitor memory usage for a week and adjust requests to P99 usage."
    }
  ],
  "overall_verdict": "approved_with_comments"
}

[RISK_LEVEL]
This is a high-risk workflow. Your output will be used to inform automated merge gates and deployment decisions. If the diff is ambiguous or you lack critical context (like node capacity), state your uncertainty clearly in the rationale fields and escalate the overall_verdict to "needs_review."

To adapt this template, start by replacing the [INPUT] placeholders with data from your GitOps or CI pipeline. The [diff] should be the raw output of kubectl diff or a unified diff from your IaC repository. If you are integrating this into an automated system, parse the JSON output and use the overall_verdict field to gate the merge or deployment. For high-severity findings, route the report to a human reviewer. The [OUTPUT_SCHEMA] is designed to be machine-readable, so you can write a validator that checks for the presence of required fields and rejects malformed responses before they affect a pipeline decision.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder must be populated for the prompt to produce reliable output. Validate inputs before sending to the model. Incomplete or malformed inputs will cause the prompt to miss critical risks or produce unactionable output.

PlaceholderPurposeExampleValidation Notes

[CURRENT_CONFIG]

The existing pod resource spec (requests and limits for CPU and memory) before the change. Used as the baseline for comparison.

resources: requests: cpu: 500m memory: 512Mi limits: cpu: 1000m memory: 1Gi

Must be valid Kubernetes YAML. Parse check: confirm presence of resources.requests and resources.limits blocks. If null, treat as a new workload with no prior configuration.

[PROPOSED_CONFIG]

The proposed pod resource spec after the change. Compared against [CURRENT_CONFIG] to identify deltas.

resources: requests: cpu: 1000m memory: 1Gi limits: cpu: 2000m memory: 2Gi

Must be valid Kubernetes YAML. Parse check: confirm presence of resources.requests and resources.limits blocks. Must not be identical to [CURRENT_CONFIG]; if identical, reject with no-op status.

[WORKLOAD_NAME]

The name of the Kubernetes workload (Deployment, StatefulSet, DaemonSet, etc.) being modified. Provides context for scheduling and cost analysis.

payment-processor

Non-empty string. Must match a valid Kubernetes resource name pattern (lowercase alphanumeric and hyphens). Used to anchor findings to a specific workload in the output.

[WORKLOAD_TYPE]

The Kubernetes resource type of the workload. Affects scheduling semantics and QoS class interpretation.

Deployment

Must be one of: Deployment, StatefulSet, DaemonSet, ReplicaSet, Job, CronJob. Enum check required. Defaults to Deployment if not specified, but explicit input is preferred.

[NAMESPACE]

The Kubernetes namespace where the workload runs. Required for resource quota checks and cost allocation context.

production

Non-empty string. Must match a valid namespace name pattern. If null, prompt should request namespace before proceeding; namespace-scoped quota and priority class checks depend on this value.

[NODE_CAPACITY_HINT]

Optional hint about the node type or capacity available in the target cluster. Improves scheduling risk accuracy.

nodes: 4 vCPU, 16GB RAM

Optional. If provided, must be a human-readable description of node capacity. If null, scheduling risk assessment will be conservative and flag potential overcommit without node context.

[COST_MODEL]

Optional cost model parameters for estimating the financial impact of resource changes. Enables cost delta calculations.

cpu_per_core_hour: 0.04, memory_per_gb_hour: 0.005

Optional. If provided, must include cpu_per_core_hour and memory_per_gb_hour as numeric values. If null, cost impact section will be qualitative rather than quantitative.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Pod Resource Limit and Request Change Review Prompt into a CI/CD pipeline or platform engineering workflow.

This prompt is designed to be called programmatically within a GitOps or CI/CD pipeline, triggered by a pull request that modifies Kubernetes manifests, Helm values files, or Kustomize overlays. The primary integration point is a webhook or pipeline step that extracts the diff of resource configuration changes and passes it as the [CONFIGURATION_DIFF] input. The application harness is responsible for gathering the necessary context—such as the target cluster's current node capacity, the namespace's existing ResourceQuota, and the affected workload's historical resource utilization metrics—and injecting them into the [CLUSTER_CONTEXT] and [WORKLOAD_HISTORY] placeholders. This ensures the model's analysis is grounded in operational reality, not just the manifest syntax.

The harness must enforce a strict validation layer around the model's structured output. After receiving the JSON response, the system should parse it and run a series of checks: verify that the qosClassChange field matches a known set of values (Guaranteed, Burstable, BestEffort), confirm that each finding in the findings array has a non-empty severity and affectedResource, and ensure the overallStabilityAssessment is one of the expected enum values. If the output fails schema validation, the harness should implement a retry loop with a maximum of two attempts, feeding the validation error message back into the prompt's [PREVIOUS_ERROR] placeholder to guide self-correction. After two failed retries, the review should be escalated to a human platform engineer with the raw diff and the failed validation log.

Given the high-risk nature of resource misconfiguration—which can lead to OOM kills, node pressure, or cascading pod evictions—a human approval gate is mandatory for any change flagged with a severity of critical or a riskScore above a configurable threshold (e.g., 8/10). The harness should post the model's structured analysis as a comment on the pull request, explicitly calling out the critical findings and blocking the merge until a designated platform team member approves it. For lower-severity changes, the analysis can serve as an informational review comment. Log every invocation, including the input diff, the model's raw and parsed output, the validation result, and the final human decision, to an audit trail for post-incident review and prompt performance evaluation over time.

IMPLEMENTATION TABLE

Expected Output Contract

The model must return a JSON object matching this structure. Validate every field before consuming the output downstream.

Field or ElementType or FormatRequiredValidation Rule

change_summary

object

Must contain 'resource_type', 'namespace', 'workload_name', 'container_name' as string fields. Schema check before parsing.

change_summary.change_type

enum string

Must be one of: 'request_increase', 'request_decrease', 'limit_increase', 'limit_decrease', 'both_modified', 'new_resource_definition'. Enum validation on parse.

resource_delta

object

Must contain 'cpu' and 'memory' objects, each with 'before' and 'after' fields containing 'request' and 'limit' string values in Kubernetes quantity format. Regex check for valid quantity strings.

qos_class_change

object

Must contain 'before' and 'after' fields with enum values: 'Guaranteed', 'Burstable', 'BestEffort'. If QoS class changed, 'impact_description' string field required.

oom_risk_assessment

object

Must contain 'risk_level' enum: 'low', 'medium', 'high', 'critical'. If 'high' or 'critical', 'evidence' array of strings required with specific conditions triggering risk. Array length check.

scheduling_impact

object

Must contain 'feasibility' enum: 'no_impact', 'may_cause_pending', 'likely_unschedulable'. If not 'no_impact', 'node_constraints' array of strings required describing limiting factors. Conditional field presence check.

cost_implication

object

Must contain 'direction' enum: 'increase', 'decrease', 'neutral'. If 'increase', 'estimated_scale' string required with qualitative description. Null allowed for 'estimated_scale' when direction is 'neutral'.

affected_workload_stability

enum string

Must be one of: 'improved', 'degraded', 'unchanged', 'uncertain'. If 'degraded' or 'uncertain', 'stability_concerns' array of strings required. Array length must be >= 1 when condition met.

recommendations

array of objects

Each object must have 'priority' enum: 'critical', 'recommended', 'optional', 'action' string, and 'rationale' string. Array length must be >= 1. Schema validation on each element.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when reviewing pod resource changes and how to guard against it in production.

01

Misinterpreting Absolute vs. Relative Changes

What to watch: The model treats a small absolute change (e.g., +50Mi memory) as low risk when the container is already near its limit, or flags a large relative change (e.g., doubling a tiny request) as high severity. Guardrail: Always provide current and proposed values with utilization percentages. Include a pre-processing step that calculates the percentage delta and current headroom before the prompt runs.

02

Ignoring QoS Class Side Effects

What to watch: The review misses that changing requests to equal limits (Guaranteed QoS) or removing requests entirely (BestEffort QoS) fundamentally alters eviction priority under node pressure. Guardrail: Add a deterministic pre-check that computes the resulting QoS class from the proposed spec and injects it as a labeled field in the prompt context. Require the model to explicitly state the QoS class transition in its output.

03

Overlooking Burstable Workload Patterns

What to watch: The model recommends lowering CPU limits based on average usage, ignoring that the workload is bursty and relies on limit headroom for cold starts or traffic spikes. Guardrail: Require historical usage percentiles (P50, P95, P99) as a required input, not just averages. Instruct the model to compare the proposed limit against P99 usage and flag any limit below P99 as high risk.

04

Hallucinating Node Capacity Constraints

What to watch: The model invents specific node types, allocatable capacity numbers, or cluster-wide resource totals without grounding in provided infrastructure context. Guardrail: Make node pool information (instance types, allocatable CPU/memory per node, current pod density) a required input block. If not provided, instruct the model to state 'Insufficient node context to assess schedulability' rather than assuming defaults.

05

Failing to Detect HPA/VPA Conflicts

What to watch: The review approves a manual resource change without checking whether a HorizontalPodAutoscaler or VerticalPodAutoscaler manages the same workload, leading to immediate reconciliation and thrashing. Guardrail: Include HPA/VPA ownership metadata in the prompt input. Add a validation rule: if the workload is managed by an autoscaler, the output must include a warning and recommend updating the autoscaler spec instead of the pod template directly.

06

Confusing Request and Limit Semantics

What to watch: The model treats memory requests and limits as interchangeable, missing that setting a low memory request with a high limit creates overcommit risk, or that setting memory request > limit is invalid. Guardrail: Add a schema validation step before the LLM call that rejects impossible configurations (request > limit). Include a prompt instruction that requires separate analysis of request adequacy (scheduling) and limit adequacy (OOM prevention).

IMPLEMENTATION TABLE

Evaluation Rubric

Test output quality against these criteria before shipping the prompt to production. Run against a golden dataset of 10-15 known resource diffs with expected verdicts.

CriterionPass StandardFailure SignalTest Method

OOM Risk Detection

Correctly identifies all diffs that increase memory limits or requests without corresponding memory limit increases, flagging OOM risk.

Misses a diff where memory request increases but limit stays flat; or flags a diff where both request and limit increase proportionally.

Run against 5 diffs with known OOM risk and 5 without. Measure recall >= 0.95 and precision >= 0.90.

QoS Class Change Identification

Correctly detects when a diff changes a pod's QoS class (Guaranteed, Burstable, BestEffort) and states the before/after class.

Misses a QoS class transition, such as when removing a limit from a previously Guaranteed pod; or misidentifies the resulting class.

Run against 3 diffs that change QoS class and 3 that do not. Require exact match on before/after class labels.

Scheduling Impact Assessment

Flags diffs that introduce node affinity conflicts, impossible resource requests exceeding cluster capacity, or topology spread constraint violations.

Fails to flag a request that exceeds the largest node size in the cluster; or flags a benign change as a scheduling risk.

Run against 4 diffs with known scheduling impact and 4 without. Check that flagged diffs include a specific reason tied to cluster context.

Cost Implication Flagging

Identifies diffs that materially increase CPU or memory requests and provides a directional cost impact statement (increase, decrease, neutral).

Misses a 2x memory request increase; or provides a cost statement without referencing the magnitude of change.

Run against 5 diffs with known cost direction. Require correct directional label and a magnitude qualifier (e.g., significant increase).

Structured Output Schema Compliance

Output is valid JSON matching the [OUTPUT_SCHEMA] exactly, with all required fields present and no extra top-level keys.

Output is missing required fields such as affected_workloads or qos_class_change; or contains unparseable JSON.

Validate output against the [OUTPUT_SCHEMA] using a JSON Schema validator. Require zero validation errors across all golden dataset runs.

Affected Workload Stability Verdict

Provides a stability verdict (stable, degraded, at-risk) that is consistent with the identified findings and their severity.

Verdict is at-risk but no high-severity findings are present; or verdict is stable when an OOM risk finding exists.

Run against 10 diffs with pre-labeled expected verdicts. Require exact match on verdict label for at least 9 out of 10.

False Positive Rate on No-Op Changes

Returns no findings or only informational notes for diffs that are whitespace-only, comment-only, or no-op resource changes.

Generates a warning or finding for a diff that changes only a comment or formatting in the YAML.

Run against 3 no-op diffs. Require zero findings with severity above informational.

Human Approval Trigger Accuracy

Flags output with requires_human_approval: true when and only when a destroy operation, QoS class downgrade, or >50% resource reduction is detected.

Sets requires_human_approval: false for a QoS class downgrade; or sets it to true for a minor request bump.

Run against 5 diffs with known approval triggers and 5 without. Require exact boolean match on all 10.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt template and a single resource diff. Remove structured output schema requirements initially—ask for a plain-text risk summary instead. Use a frontier model (GPT-4o, Claude 3.5 Sonnet) with default temperature. Feed only the changed YAML snippet, not the full deployment context.

code
Review this Kubernetes resource change for OOM risk and scheduling impact:

[RESOURCE_DIFF]

List the top 3 risks in plain language.

Watch for

  • Missing QoS class analysis when requests and limits are changed independently
  • Overlooking node selector or affinity interactions with resource changes
  • No cost impact mention—prototype often skips financial implications
  • False confidence on burstable QoS workloads
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.