ScaleAdapter API reference
The adapter exposes a scale-compatible surface over a target. Grant only the necessary target/subresource permissions and give the target replica field one writer. A desired buffer count does not prove nodes are ready.
API details
Section titled “API details”Group: autoscaling.kedify.io. Kind: ScaleAdapter. 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.
v1alpha1 fields
Section titled “v1alpha1 fields”Served: true; storage: true.
| Field | Type | Required | Schema default | Meaning and validation |
|---|---|---|---|---|
spec | object | No | Not specified | ScaleAdapterSpec defines the desired state of ScaleAdapter x-kubernetes-validations: [{“message”:“currentReplicasPath can only be set together with desiredReplicasPath”,“rule”:“!has(self.currentReplicasPath) || has(self.desiredReplicasPath)”}] |
spec.currentReplicasPath | string | No | Not specified | CurrentReplicasPath is a dot-separated field path (e.g. “.status.size”) to the current replica count reported by the target resource, mirrored into status.replicas. It can only be set together with DesiredReplicasPath. When DesiredReplicasPath is set and this is not, status.replicas mirrors the desired replica count instead. minLength: 1 |
spec.desiredReplicasPath | string | No | Not specified | DesiredReplicasPath is a dot-separated field path (e.g. “.spec.size”) to the desired replica count on the target resource. When set, the adapter reads and writes desired replicas through this field instead of the target’s /scale subresource, which allows adapting targets that do not implement the scale contract at all. This requires RBAC for get and update on the whole target resource rather than just its /scale subresource. Wildcards and array indices are not supported. minLength: 1 |
spec.replicas | integer | No | Not specified | Replicas is the desired replica count forwarded to the target, through its /scale subresource or through DesiredReplicasPath. It is initialized by the controller from the target’s current desired replicas and afterwards managed by the HPA (or KEDA for scale to/from zero) through this adapter’s /scale subresource. Leave it unset when creating the adapter. minimum: 0 |
spec.selector | object | Yes | Not specified | Selector selects the Pods that belong to the target workload. It is serialized into status.selector, which the HPA requires to be non-empty. The matching labels must be present on the Pods of the target workload (for Agones Fleets, add them to the Pod template at spec.template.spec.template.metadata.labels). |
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.targetRef | object | Yes | Not specified | TargetRef references the resource whose desired replicas are managed through this adapter, by default through its /scale subresource. |
spec.targetRef.apiVersion | string | Yes | Not specified | APIVersion of the target resource, e.g. “agones.dev/v1”. minLength: 1 |
spec.targetRef.kind | string | Yes | Not specified | Kind of the target resource, e.g. “Fleet”. minLength: 1 |
spec.targetRef.name | string | Yes | Not specified | Name of the target resource. minLength: 1 |
status
Section titled “status”| Field | Type | Required | Schema default | Meaning and validation |
|---|---|---|---|---|
status | object | No | Not specified | ScaleAdapterStatus defines the observed state of ScaleAdapter |
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.replicas | integer | Yes | Not specified | Replicas mirrors the current replica count reported by the target through its /scale subresource or CurrentReplicasPath. |
status.selector | string | No | Not specified | Selector is the serialized form of spec.selector, exposed through this adapter’s /scale subresource for the HPA. |
status.targetDesiredReplicas | integer | No | Not specified | TargetDesiredReplicas is the desired replica count last observed on (or written to) the target. It is used to detect competing replica writers and for troubleshooting. |
Inspect the installed contract
Section titled “Inspect the installed contract”kubectl get crd scaleadapters.autoscaling.kedify.io -o yamlkubectl explain scaleadapter.spec --recursiveCompare 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
Section titled “Use, verify and diagnose”- Scale Adapter: custom scaling targets
- Scale custom targets and prewarm node capacity
- Prewarm node capacity with Karpenter
- Prewarm node capacity with Cluster Autoscaler
- Prewarm node capacity on GKE
Conditions
Section titled “Conditions”| Type | Meaning |
|---|---|
Ready | Target resolved, selector usable, replicas synchronized |
TargetResolved | spec.targetRef maps to a resource with a readable /scale (or readable replica field paths) |
SelectorValid | spec.selector is a valid, non-empty selector |
SelectorMatchesPods | Warning only: False when the target reports replicas but the selector matches no Pods (labels missing from the Pod template) |
ConflictingReplicaWriter | Warning only: True when something else wrote the target’s desired replicas |