# PodResourceAutoscaler API reference

Choose exactly one target or selector and define the managed container/resource sides. Set bounds appropriate to the workload. CPU and memory resizing require supported Kubernetes resize behavior, feasible node capacity and permissions; status/events distinguish a decision from successful application.

## API details

Group: `keda.kedify.io`. Kind: `PodResourceAutoscaler`. Scope: **Namespaced**.

Defaults below are schema defaults only. “Not specified” does not imply a controller default of zero or false. Required fields are required within their containing object. Runtime behavior can impose additional conditions described in the [capability guide](https://docs.kedify.io/features/pod-resource-autoscaler/).

## v1alpha1 fields

Served: `true`; storage: `true`.

### spec

| Field | Type | Required | Schema default | Meaning and validation |
| --- | --- | --- | --- | --- |
| `spec` | object | No | Not specified | PodResourceAutoscalerSpec defines the desired state of PodResourceAutoscaler x-kubernetes-validations: [{“message”:“PodResourceAutoscaler must have either a pod selector or target specified”,“rule”:“has(self.target) != has(self.selector)”},{“message”:“Specify at least one of policy.cpu.requests, policy.cpu.limits, policy.memory.requests, policy.memory.limits”,“rule”:“(has(self.policy.cpu) && (has(self.policy.cpu.requests) \|\| has(self.policy.cpu.limits))) \|\| (has(self.policy.memory) && (has(self.policy.memory.requests) \|\| has(self.policy.memory.limits)))”}] |
| `spec.bounds` | object | No | Not specified | Bounds defines optional bounds and step constraints for request/limit scaling |
| `spec.bounds.cpu` | object | No | Not specified | CPU defines bounds/steps for CPU requests and limits. x-kubernetes-validations: [{“message”:“Specify requests and/or limits bounds”,“rule”:“has(self.requests) \|\| has(self.limits)”}] |
| `spec.bounds.cpu.limits` | object | No | Not specified | Limits defines optional bounds/steps for limits. If omitted, scaling for this side has no extra bounds from this section. |
| `spec.bounds.cpu.limits.max` | integer or string | No | Not specified | Max defines maximum allowed value for the resource pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.cpu.limits.min` | integer or string | No | Not specified | Min defines minimum allowed value for the resource pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.cpu.limits.step` | integer or string | No | Not specified | Step defines maximum absolute change per resize pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.cpu.limits.stepPercent` | integer | No | Not specified | StepPercent defines maximum percent change per resize (of current value) minimum: 1; maximum: 100 |
| `spec.bounds.cpu.requests` | object | No | Not specified | Requests defines optional bounds/steps for requests. If omitted, scaling for this side has no extra bounds from this section. |
| `spec.bounds.cpu.requests.max` | integer or string | No | Not specified | Max defines maximum allowed value for the resource pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.cpu.requests.min` | integer or string | No | Not specified | Min defines minimum allowed value for the resource pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.cpu.requests.step` | integer or string | No | Not specified | Step defines maximum absolute change per resize pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.cpu.requests.stepPercent` | integer | No | Not specified | StepPercent defines maximum percent change per resize (of current value) minimum: 1; maximum: 100 |
| `spec.bounds.memory` | object | No | Not specified | Memory defines bounds/steps for memory requests and limits. x-kubernetes-validations: [{“message”:“Specify requests and/or limits bounds”,“rule”:“has(self.requests) \|\| has(self.limits)”}] |
| `spec.bounds.memory.limits` | object | No | Not specified | Limits defines optional bounds/steps for limits. If omitted, scaling for this side has no extra bounds from this section. |
| `spec.bounds.memory.limits.max` | integer or string | No | Not specified | Max defines maximum allowed value for the resource pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.memory.limits.min` | integer or string | No | Not specified | Min defines minimum allowed value for the resource pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.memory.limits.step` | integer or string | No | Not specified | Step defines maximum absolute change per resize pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.memory.limits.stepPercent` | integer | No | Not specified | StepPercent defines maximum percent change per resize (of current value) minimum: 1; maximum: 100 |
| `spec.bounds.memory.requests` | object | No | Not specified | Requests defines optional bounds/steps for requests. If omitted, scaling for this side has no extra bounds from this section. |
| `spec.bounds.memory.requests.max` | integer or string | No | Not specified | Max defines maximum allowed value for the resource pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.memory.requests.min` | integer or string | No | Not specified | Min defines minimum allowed value for the resource pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.memory.requests.step` | integer or string | No | Not specified | Step defines maximum absolute change per resize pattern: ”^(\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))(([KMGTPE]i)\|[numkMGTPE]\|([eE](\+\|-)?(([0-9]+(\.[0-9]*)?)\|(\.[0-9]+))))?$” |
| `spec.bounds.memory.requests.stepPercent` | integer | No | Not specified | StepPercent defines maximum percent change per resize (of current value) minimum: 1; maximum: 100 |
| `spec.containerName` | string | Yes | Not specified | ContainerName what container in the pod should be updated minLength: 1 |
| `spec.paused` | boolean | No | `false` | Paused if set to true, can make the controller ignore this CR |
| `spec.policy` | object | Yes | Not specified | Policy defines how usage is evaluated and when scaling occurs |
| `spec.policy.after` | string | No | `"containerReady"` | After specifies the pod/container state required before a resize is applied enum: [“running”,“containerReady”,“podReady”] |
| `spec.policy.consecutiveSamples` | integer | Yes | Not specified | ConsecutiveSamples is the number of consecutive samples that must breach a threshold minimum: 1 |
| `spec.policy.cooldown` | string | Yes | Not specified | Cooldown is the minimum time between resize actions for a pod example values: 1m, 2m30s, 5m minLength: 1 |
| `spec.policy.cpu` | object | No | Not specified | CPU defines thresholds and target utilization for CPU x-kubernetes-validations: [{“message”:“Specify requests and/or limits policy”,“rule”:“has(self.requests) \|\| has(self.limits)”}] |
| `spec.policy.cpu.limits` | object | No | Not specified | Limits defines utilization policy against container resource limits. If omitted, PRA does not scale this resource’s limits side. x-kubernetes-validations: [{“message”:“scaleUpThreshold must be greater than scaleDownThreshold”,“rule”:“self.scaleUpThreshold > self.scaleDownThreshold”},{“message”:“consecutiveSamples override must be >= 1”,“rule”:“!has(self.consecutiveSamples) \|\| self.consecutiveSamples >= 1”}] |
| `spec.policy.cpu.limits.consecutiveSamples` | integer | No | Not specified | ConsecutiveSamples optionally overrides policy.consecutiveSamples for this resource |
| `spec.policy.cpu.limits.cooldown` | string | No | Not specified | Cooldown optionally overrides policy.cooldown for this resource example values: 30s, 1m, 2m30s minLength: 1 |
| `spec.policy.cpu.limits.scaleDownThreshold` | integer | Yes | Not specified | ScaleDownThreshold triggers scale-down if utilization is <= this value (percent) minimum: 0; maximum: 100 |
| `spec.policy.cpu.limits.scaleUpThreshold` | integer | Yes | Not specified | ScaleUpThreshold triggers scale-up if utilization is >= this value (percent) minimum: 1; maximum: 100 |
| `spec.policy.cpu.limits.targetUtilization` | integer | Yes | Not specified | TargetUtilization is the desired utilization after resize (percent) minimum: 1; maximum: 100 |
| `spec.policy.cpu.requests` | object | No | Not specified | Requests defines utilization policy against container resource requests. If omitted, PRA does not scale this resource’s requests side. x-kubernetes-validations: [{“message”:“scaleUpThreshold must be greater than scaleDownThreshold”,“rule”:“self.scaleUpThreshold > self.scaleDownThreshold”},{“message”:“consecutiveSamples override must be >= 1”,“rule”:“!has(self.consecutiveSamples) \|\| self.consecutiveSamples >= 1”}] |
| `spec.policy.cpu.requests.consecutiveSamples` | integer | No | Not specified | ConsecutiveSamples optionally overrides policy.consecutiveSamples for this resource |
| `spec.policy.cpu.requests.cooldown` | string | No | Not specified | Cooldown optionally overrides policy.cooldown for this resource example values: 30s, 1m, 2m30s minLength: 1 |
| `spec.policy.cpu.requests.scaleDownThreshold` | integer | Yes | Not specified | ScaleDownThreshold triggers scale-down if utilization is <= this value (percent) minimum: 0; maximum: 100 |
| `spec.policy.cpu.requests.scaleUpThreshold` | integer | Yes | Not specified | ScaleUpThreshold triggers scale-up if utilization is >= this value (percent) minimum: 1; maximum: 100 |
| `spec.policy.cpu.requests.targetUtilization` | integer | Yes | Not specified | TargetUtilization is the desired utilization after resize (percent) minimum: 1; maximum: 100 |
| `spec.policy.delay` | string | No | `"15s"` | Delay is the wait duration after `after` becomes true before a resize is applied example values: 15s, 30s, 1m, 2m30s minLength: 1 |
| `spec.policy.memory` | object | No | Not specified | Memory defines thresholds and target utilization for memory x-kubernetes-validations: [{“message”:“Specify requests and/or limits policy”,“rule”:“has(self.requests) \|\| has(self.limits)”}] |
| `spec.policy.memory.limits` | object | No | Not specified | Limits defines utilization policy against container resource limits. If omitted, PRA does not scale this resource’s limits side. x-kubernetes-validations: [{“message”:“scaleUpThreshold must be greater than scaleDownThreshold”,“rule”:“self.scaleUpThreshold > self.scaleDownThreshold”},{“message”:“consecutiveSamples override must be >= 1”,“rule”:“!has(self.consecutiveSamples) \|\| self.consecutiveSamples >= 1”}] |
| `spec.policy.memory.limits.consecutiveSamples` | integer | No | Not specified | ConsecutiveSamples optionally overrides policy.consecutiveSamples for this resource |
| `spec.policy.memory.limits.cooldown` | string | No | Not specified | Cooldown optionally overrides policy.cooldown for this resource example values: 30s, 1m, 2m30s minLength: 1 |
| `spec.policy.memory.limits.scaleDownThreshold` | integer | Yes | Not specified | ScaleDownThreshold triggers scale-down if utilization is <= this value (percent) minimum: 0; maximum: 100 |
| `spec.policy.memory.limits.scaleUpThreshold` | integer | Yes | Not specified | ScaleUpThreshold triggers scale-up if utilization is >= this value (percent) minimum: 1; maximum: 100 |
| `spec.policy.memory.limits.targetUtilization` | integer | Yes | Not specified | TargetUtilization is the desired utilization after resize (percent) minimum: 1; maximum: 100 |
| `spec.policy.memory.requests` | object | No | Not specified | Requests defines utilization policy against container resource requests. If omitted, PRA does not scale this resource’s requests side. x-kubernetes-validations: [{“message”:“scaleUpThreshold must be greater than scaleDownThreshold”,“rule”:“self.scaleUpThreshold > self.scaleDownThreshold”},{“message”:“consecutiveSamples override must be >= 1”,“rule”:“!has(self.consecutiveSamples) \|\| self.consecutiveSamples >= 1”}] |
| `spec.policy.memory.requests.consecutiveSamples` | integer | No | Not specified | ConsecutiveSamples optionally overrides policy.consecutiveSamples for this resource |
| `spec.policy.memory.requests.cooldown` | string | No | Not specified | Cooldown optionally overrides policy.cooldown for this resource example values: 30s, 1m, 2m30s minLength: 1 |
| `spec.policy.memory.requests.scaleDownThreshold` | integer | Yes | Not specified | ScaleDownThreshold triggers scale-down if utilization is <= this value (percent) minimum: 0; maximum: 100 |
| `spec.policy.memory.requests.scaleUpThreshold` | integer | Yes | Not specified | ScaleUpThreshold triggers scale-up if utilization is >= this value (percent) minimum: 1; maximum: 100 |
| `spec.policy.memory.requests.targetUtilization` | integer | Yes | Not specified | TargetUtilization is the desired utilization after resize (percent) minimum: 1; maximum: 100 |
| `spec.policy.pollInterval` | string | Yes | Not specified | PollInterval is how often kubelet stats are polled per node example values: 5s, 10s, 30s, 1m minLength: 1 |
| `spec.priority` | integer | No | `0` | Priority in case multiple (unpaused) PodResourceAutoscaler CRs matches, only the one with the highest priority will be applied. If not specified, it is 0 and if multiple PodResourceAutoscaler with the same priority matches the pod’s label selector, then the next one that’s closest to now() is chosen. Again if multiple match, then lexicographically smaller is picked (CR name). |
| `spec.selector` | object | No | Not specified | Selector is the general label selector spec that identifies one or multiple Pods if selector is specified, don’t use the target |
| `spec.selector.matchExpressions` | array | No | Not specified | matchExpressions is a list of label selector requirements. The requirements are ANDed. |
| `spec.selector.matchExpressions[]` | object | No | Not specified | A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. |
| `spec.selector.matchExpressions[].key` | string | Yes | Not specified | key is the label key that the selector applies to. |
| `spec.selector.matchExpressions[].operator` | string | Yes | Not specified | operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. |
| `spec.selector.matchExpressions[].values` | array | No | Not specified | values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. |
| `spec.selector.matchExpressions[].values[]` | string | No | Not specified |  |
| `spec.selector.matchLabels` | object | No | Not specified | matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed. |
| `spec.selector.matchLabels.*` | string | No | Not specified |  |
| `spec.target` | object | No | Not specified | Target is the reference to a workload whose pods should be modified if target is specified, don’t use the selector |
| `spec.target.kind` | string | Yes | Not specified | Kind specifies the target workload whose containers will be obtaining the resource updates The ‘rollout’ kind refers to an Argo Rollout in argoproj.io/v1alpha1. enum: [“deployment”,“daemonset”,“statefulset”,“rollout”] |
| `spec.target.name` | string | Yes | Not specified | minLength: 1 |

### status

| Field | Type | Required | Schema default | Meaning and validation |
| --- | --- | --- | --- | --- |
| `status` | object | No | Not specified | PodResourceAutoscalerStatus defines the observed state of PodResourceAutoscaler |
| `status.conditions` | array | No | Not specified |  |
| `status.conditions[]` | object | No | Not specified | Condition contains details for one aspect of the current state of this API Resource. |
| `status.conditions[].lastTransitionTime` | string | Yes | Not specified | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. |
| `status.conditions[].message` | string | Yes | Not specified | message is a human readable message indicating details about the transition. This may be an empty string. maxLength: 32768 |
| `status.conditions[].observedGeneration` | integer | No | Not specified | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. minimum: 0 |
| `status.conditions[].reason` | string | Yes | Not specified | reason contains a programmatic identifier indicating the reason for the condition’s last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. minLength: 1; maxLength: 1024; pattern: ”^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$” |
| `status.conditions[].status` | string | Yes | Not specified | status of the condition, one of True, False, Unknown. enum: [“True”,“False”,“Unknown”] |
| `status.conditions[].type` | string | Yes | Not specified | type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316; pattern: ”^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$” |
| `status.effectiveSelector` | object | No | Not specified | A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. |
| `status.effectiveSelector.matchExpressions` | array | No | Not specified | matchExpressions is a list of label selector requirements. The requirements are ANDed. |
| `status.effectiveSelector.matchExpressions[]` | object | No | Not specified | A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. |
| `status.effectiveSelector.matchExpressions[].key` | string | Yes | Not specified | key is the label key that the selector applies to. |
| `status.effectiveSelector.matchExpressions[].operator` | string | Yes | Not specified | operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. |
| `status.effectiveSelector.matchExpressions[].values` | array | No | Not specified | values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. |
| `status.effectiveSelector.matchExpressions[].values[]` | string | No | Not specified |  |
| `status.effectiveSelector.matchLabels` | object | No | Not specified | matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed. |
| `status.effectiveSelector.matchLabels.*` | string | No | Not specified |  |
| `status.lastScaleAction` | string | No | Not specified |  |
| `status.lastScaleResourceChange` | string | No | Not specified | LastScaleResourceChange summarizes request/limit changes from the last scale action. |
| `status.lastScaleTime` | string | No | Not specified |  |
| `status.observedGeneration` | integer | No | Not specified |  |
| `status.scaling` | boolean | No | Not specified |  |

## Inspect the installed contract

```bash
kubectl get crd podresourceautoscalers.keda.kedify.io -o yaml
kubectl explain podresourceautoscaler.spec --recursive
```

Compare served/storage versions and schema before applying configuration. Inspect the resource’s status and events after changing its owning source; schema acceptance alone does not prove successful reconciliation.

## Use, verify and diagnose

- [Pod Resource Autoscaler (PRA)](https://docs.kedify.io/features/pod-resource-autoscaler/)

- [Test automatic rightsizing with PRA](https://docs.kedify.io/how-to/pra-vertical-scaling-with-load-generator/)

- [Pod resources do not resize as expected](https://docs.kedify.io/troubleshooting/vertical-scaling/)

## Validation

CRD-level validation enforces:

- XOR `target` / `selector`

- at least one side among `cpu.requests|cpu.limits|memory.requests|memory.limits`

- `scaleUpThreshold > scaleDownThreshold`

- percent range checks (thresholds and `stepPercent`)

- `consecutiveSamples >= 1`

- `bounds` supports only `cpu` and `memory` keys

Runtime validation/guards include:

- parseable `pollInterval`, `cooldown`, and `delay` (if set)

- `after` must be one of `running|containerReady|podReady`

- selected container exists

- baseline resources exist and are non-zero for configured sides

- counter resets / missing samples are handled (skipped)

## Resource Bounds and Step Control

`.spec.bounds` is optional. If bounds are omitted for a managed side, scaling still works without extra clamping or step caps.

Bounds are configured per resource and per side:

- `bounds.cpu.requests` / `bounds.cpu.limits`

- `bounds.memory.requests` / `bounds.memory.limits`

Each side supports:

- `min`

- `max`

- `step` (absolute max delta per action)

- `stepPercent` (relative max delta per action)

If both `step` and `stepPercent` are set, the smaller cap is applied.

## Scaling Policy

Top-level policy fields:

- `pollInterval`: per-pod evaluation interval (node poll interval becomes the minimum interval among tracked pods on a node).

- `consecutiveSamples`: required, must be `>= 1`

- `cooldown`: required duration (minimum time between resize actions for the pod)

- `after`: optional apply gate, one of `running|containerReady|podReady` (default `containerReady`)

- `delay`: optional duration before apply (default `15s`)

Resource policies are optional and can be configured per resource and per “side”:

- `policy.cpu.requests` / `policy.cpu.limits`

- `policy.memory.requests` / `policy.memory.limits`

Each utilization policy includes:

- `scaleUpThreshold` (percent)

- `scaleDownThreshold` (percent)

- `targetUtilization` (percent)

- `consecutiveSamples` (optional override)

- `cooldown` (optional override)

Notes:

- If you specify `policy.cpu`, you must configure `requests` and/or `limits` under it.

- If you specify `policy.memory`, you must configure `requests` and/or `limits` under it.

- `scaleUpThreshold` must be greater than `scaleDownThreshold`.

At least one of `policy.cpu.requests|policy.cpu.limits|policy.memory.requests|policy.memory.limits` must be set.

### How scaling decisions work

- CPU usage is derived from kubelet cumulative counters (rate over time). Memory usage is derived from kubelet working set bytes.

- For each configured side, utilization is computed as `usage / baseline * 100`, where the baseline is the container’s request or limit for that side.

- Utilization is evaluated independently for each configured side.

- Scale up if any configured side requests scale up.

- Scale down only if no side requests scale up and at least one side requests scale down.

- Desired values are computed from `targetUtilization` and current usage (separately per side), using `desired = usage / (targetUtilization / 100)`.

- `requests <= limits` is always enforced.

- Resize apply is gated by `after` and `delay`, and skipped while a pod resize is pending/in progress.

Additional details:

- CPU needs an initial warm-up sample before a first rate can be computed.

- Threshold checks are inclusive (`>=` for up, `<=` for down).

- CPU cores used are computed as:

   

  `cores_used = ((cpu_ns_now - cpu_ns_prev) / 1e9) / dt_seconds`

## Addressing Pods

You can target pods in two mutually exclusive ways:

- `.spec.selector`

- `.spec.target`

Exactly one of these must be set.

Allowed target kinds:

- `deployment`

- `statefulset`

- `daemonset`

- `rollout` (Argo Rollouts need to be [`enabled`](https://docs.kedify.io/features/pod-resource-profiles/#argo-rollout--podresourceprofile))

When using `.spec.selector`, the selector uses the same shape as `deployment.spec.selector`.

If multiple PRAs match the same pod, the winner selection is deterministic:

- highest `priority`, then earliest next-eligible time, then lexicographic PRA name

## Spec Overview

At a high level, a PRA describes:

- which pods to manage (`.spec.selector` or `.spec.target`)

- which container to resize (`.spec.containerName`)

- how to evaluate and apply resize actions (`.spec.policy`)

- optional bounds/step caps (`.spec.bounds`)

You must specify exactly one of `.spec.selector` or `.spec.target`.

#### Spec fields

- `paused`: optional bool (default `false`)

- `priority`: optional int (default `0`)

- `target`: optional workload reference (XOR with `selector`)

- `selector`: optional label selector (XOR with `target`)

- `containerName`: required string; the single container per pod to resize

- `policy`: required; evaluation and sizing rules

- `bounds`: optional; per-resource bounds and step caps for `requests` and/or `limits`

#### Status fields

- `conditions`: `Ready`, `Active`, `Scaling`, `Metrics`

- `observedGeneration`

- `effectiveSelector`

- `lastScaleTime`

- `lastScaleAction`: `scaleUp|scaleDown`

- `lastScaleResourceChange`: compact before/after delta from the last scale action

- `scaling`: boolean derived from `lastScaleTime + cooldown` window (cleared after cooldown elapses by periodic runtime sync)

Last updated: Sep 21, 2026

---
Canonical: https://docs.kedify.io/reference/kubernetes-api/podresourceautoscaler/
Source: src/content/docs/reference/kubernetes-api/podresourceautoscaler.md
Documentation index: https://docs.kedify.io/llms.txt
