Skip to content

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.

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.

Served: true; storage: true.

FieldTypeRequiredSchema defaultMeaning and validation
specobjectNoNot specifiedScaleAdapterSpec 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.currentReplicasPathstringNoNot specifiedCurrentReplicasPath 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.desiredReplicasPathstringNoNot specifiedDesiredReplicasPath 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.replicasintegerNoNot specifiedReplicas 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.selectorobjectYesNot specifiedSelector 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.matchExpressionsarrayNoNot specifiedmatchExpressions is a list of label selector requirements. The requirements are ANDed.
spec.selector.matchExpressions[]objectNoNot specifiedA label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
spec.selector.matchExpressions[].keystringYesNot specifiedkey is the label key that the selector applies to.
spec.selector.matchExpressions[].operatorstringYesNot specifiedoperator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
spec.selector.matchExpressions[].valuesarrayNoNot specifiedvalues 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[]stringNoNot specified
spec.selector.matchLabelsobjectNoNot specifiedmatchLabels 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.*stringNoNot specified
spec.targetRefobjectYesNot specifiedTargetRef references the resource whose desired replicas are managed through this adapter, by default through its /scale subresource.
spec.targetRef.apiVersionstringYesNot specifiedAPIVersion of the target resource, e.g. “agones.dev/v1”. minLength: 1
spec.targetRef.kindstringYesNot specifiedKind of the target resource, e.g. “Fleet”. minLength: 1
spec.targetRef.namestringYesNot specifiedName of the target resource. minLength: 1
FieldTypeRequiredSchema defaultMeaning and validation
statusobjectNoNot specifiedScaleAdapterStatus defines the observed state of ScaleAdapter
status.conditionsarrayNoNot specified
status.conditions[]objectNoNot specifiedCondition contains details for one aspect of the current state of this API Resource.
status.conditions[].lastTransitionTimestringYesNot specifiedlastTransitionTime 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[].messagestringYesNot specifiedmessage is a human readable message indicating details about the transition. This may be an empty string. maxLength: 32768
status.conditions[].observedGenerationintegerNoNot specifiedobservedGeneration 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[].reasonstringYesNot specifiedreason 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[].statusstringYesNot specifiedstatus of the condition, one of True, False, Unknown. enum: [“True”,“False”,“Unknown”]
status.conditions[].typestringYesNot specifiedtype 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.replicasintegerYesNot specifiedReplicas mirrors the current replica count reported by the target through its /scale subresource or CurrentReplicasPath.
status.selectorstringNoNot specifiedSelector is the serialized form of spec.selector, exposed through this adapter’s /scale subresource for the HPA.
status.targetDesiredReplicasintegerNoNot specifiedTargetDesiredReplicas is the desired replica count last observed on (or written to) the target. It is used to detect competing replica writers and for troubleshooting.
Terminal window
kubectl get crd scaleadapters.autoscaling.kedify.io -o yaml
kubectl explain scaleadapter.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.

TypeMeaning
ReadyTarget resolved, selector usable, replicas synchronized
TargetResolvedspec.targetRef maps to a resource with a readable /scale (or readable replica field paths)
SelectorValidspec.selector is a valid, non-empty selector
SelectorMatchesPodsWarning only: False when the target reports replicas but the selector matches no Pods (labels missing from the Pod template)
ConflictingReplicaWriterWarning only: True when something else wrote the target’s desired replicas