Skip to content

DistributedScaledObject API reference

The central controller owns distributed desired replicas and writes to registered member targets. Member connectivity, credentials and permissions are prerequisites. Rebalancing and failure behavior must be evaluated against workload placement requirements.

Group: keda.kedify.io. Kind: DistributedScaledObject. 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 specifiedDistributedScaledObjectSpec defines the desired state of DistributedScaledObject
spec.memberClustersarrayNoNot specifiedMemberClusters is the list of member clusters where the ScaledObject should trigger scaling of the target workloads if empty, use all available member clusters
spec.memberClusters[]objectNoNot specifiedDistributedScaledObjectMemberCluster represents a member cluster where the DistributedScaledObject should be applied.
spec.memberClusters[].namestringYesNot specifiedName is the name of the member cluster.
spec.memberClusters[].targetNamespacestringNoNot specifiedTargetNamespace is the namespace in the member cluster where the scaling should be applied. Defaults to the namespace of the owning distributed resource if not specified.
spec.memberClusters[].weightintegerYes1Weight is the weight of the member cluster for scaling distribution.
spec.rebalancingPolicyobjectYes{"gracePeriod":"1m","maxRebalancePercentage":50}RebalancingPolicy controls how the controller should behave when clusters fail
spec.rebalancingPolicy.gracePeriodstringYes"1m"FailureGracePeriod is the duration to wait before rebalancing the replicas when a member cluster becomes unhealthy
spec.rebalancingPolicy.maxRebalancePercentageintegerYes50MaxRebalancePercentage is the maximum percentage of replicas that can be rebalanced at once
spec.scaledObjectSpecobjectYesNot specifiedScaledObjectSpec is the specification of the KEDA ScaledObject x-kubernetes-validations: [{“message”:“minReplicaCount must be less than or equal to maxReplicaCount”,“rule”:“!has(self.minReplicaCount) || self.minReplicaCount <= (has(self.maxReplicaCount) ? self.maxReplicaCount : 100)”}]
spec.scaledObjectSpec.advancedobjectNoNot specifiedAdvancedConfig specifies advance scaling options
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfigobjectNoNot specifiedHorizontalPodAutoscalerConfig specifies horizontal scale config
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behaviorobjectNoNot specifiedHorizontalPodAutoscalerBehavior configures the scaling behavior of the target in both Up and Down directions (scaleUp and scaleDown fields respectively).
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleDownobjectNoNot specifiedscaleDown is scaling policy for scaling Down. If not set, the default value is to allow to scale down to minReplicas pods, with a 300 second stabilization window (i.e., the highest recommendation for the last 300sec is used).
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleDown.policiesarrayNoNot specifiedpolicies is a list of potential scaling polices which can be used during scaling. If not set, use the default values: - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. - For scale down: allow all pods to be removed in a 15s window.
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleDown.policies[]objectNoNot specifiedHPAScalingPolicy is a single policy which must hold true for a specified past interval.
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleDown.policies[].periodSecondsintegerYesNot specifiedperiodSeconds specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min).
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleDown.policies[].typestringYesNot specifiedtype is used to specify the scaling policy.
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleDown.policies[].valueintegerYesNot specifiedvalue contains the amount of change which is permitted by the policy. It must be greater than zero
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleDown.selectPolicystringNoNot specifiedselectPolicy is used to specify which policy should be used. If not set, the default value Max is used.
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleDown.stabilizationWindowSecondsintegerNoNot specifiedstabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleDown.toleranceinteger or stringNoNot specifiedtolerance is the tolerance on the ratio between the current and desired metric value under which no updates are made to the desired number of replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not set, the default cluster-wide tolerance is applied (by default 10%). For example, if autoscaling is configured with a memory consumption target of 100Mi, and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be triggered when the actual consumption falls below 95Mi or exceeds 101Mi. This is an beta field and requires the HPAConfigurableTolerance feature gate to be enabled. pattern: ”^(\+|-)?(([0-9]+(\.[0-9])?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9])?)|(\.[0-9]+))))?$”
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleUpobjectNoNot specifiedscaleUp is scaling policy for scaling Up. If not set, the default value is the higher of: * increase no more than 4 pods per 60 seconds * double the number of pods per 60 seconds No stabilization is used.
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleUp.policiesarrayNoNot specifiedpolicies is a list of potential scaling polices which can be used during scaling. If not set, use the default values: - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. - For scale down: allow all pods to be removed in a 15s window.
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleUp.policies[]objectNoNot specifiedHPAScalingPolicy is a single policy which must hold true for a specified past interval.
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleUp.policies[].periodSecondsintegerYesNot specifiedperiodSeconds specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min).
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleUp.policies[].typestringYesNot specifiedtype is used to specify the scaling policy.
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleUp.policies[].valueintegerYesNot specifiedvalue contains the amount of change which is permitted by the policy. It must be greater than zero
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleUp.selectPolicystringNoNot specifiedselectPolicy is used to specify which policy should be used. If not set, the default value Max is used.
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleUp.stabilizationWindowSecondsintegerNoNot specifiedstabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.behavior.scaleUp.toleranceinteger or stringNoNot specifiedtolerance is the tolerance on the ratio between the current and desired metric value under which no updates are made to the desired number of replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not set, the default cluster-wide tolerance is applied (by default 10%). For example, if autoscaling is configured with a memory consumption target of 100Mi, and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be triggered when the actual consumption falls below 95Mi or exceeds 101Mi. This is an beta field and requires the HPAConfigurableTolerance feature gate to be enabled. pattern: ”^(\+|-)?(([0-9]+(\.[0-9])?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9])?)|(\.[0-9]+))))?$”
spec.scaledObjectSpec.advanced.horizontalPodAutoscalerConfig.namestringNoNot specified
spec.scaledObjectSpec.advanced.restoreToOriginalReplicaCountbooleanNoNot specified
spec.scaledObjectSpec.advanced.scalingModifiersobjectNoNot specifiedScalingModifiers describes advanced scaling logic options like formula
spec.scaledObjectSpec.advanced.scalingModifiers.activationTargetstringNoNot specified
spec.scaledObjectSpec.advanced.scalingModifiers.formulastringNoNot specified
spec.scaledObjectSpec.advanced.scalingModifiers.metricTypestringNoNot specifiedMetricTargetType specifies the type of metric being targeted, and should be either “Value”, “AverageValue”, or “Utilization” enum: [“AverageValue”,“Value”]
spec.scaledObjectSpec.advanced.scalingModifiers.targetstringNoNot specified
spec.scaledObjectSpec.cooldownPeriodintegerNoNot specifiedminimum: 0
spec.scaledObjectSpec.fallbackobjectNoNot specifiedFallback is the spec for fallback options
spec.scaledObjectSpec.fallback.behaviorstringNo"static"enum: [“static”,“currentReplicas”,“currentReplicasIfHigher”,“currentReplicasIfLower”,“scalingModifiers”]
spec.scaledObjectSpec.fallback.failureThresholdintegerYesNot specifiedminimum: 0
spec.scaledObjectSpec.fallback.replicasintegerYesNot specifiedminimum: 0
spec.scaledObjectSpec.idleReplicaCountintegerNoNot specifiedminimum: 0
spec.scaledObjectSpec.initialCooldownPeriodintegerNoNot specifiedminimum: 0
spec.scaledObjectSpec.maxReplicaCountintegerNoNot specifiedminimum: 1
spec.scaledObjectSpec.minReplicaCountintegerNoNot specifiedminimum: 0
spec.scaledObjectSpec.pollingIntervalintegerNoNot specifiedminimum: 1
spec.scaledObjectSpec.scaleTargetRefobjectYesNot specifiedScaleTarget holds the reference to the scale target Object
spec.scaledObjectSpec.scaleTargetRef.apiVersionstringNoNot specified
spec.scaledObjectSpec.scaleTargetRef.envSourceContainerNamestringNoNot specified
spec.scaledObjectSpec.scaleTargetRef.kindstringNoNot specified
spec.scaledObjectSpec.scaleTargetRef.namestringYesNot specifiedminLength: 1
spec.scaledObjectSpec.triggersarrayYesNot specifiedminItems: 1
spec.scaledObjectSpec.triggers[]objectNoNot specifiedScaleTriggers reference the scaler that will be used
spec.scaledObjectSpec.triggers[].authenticationRefobjectNoNot specifiedAuthenticationRef points to the TriggerAuthentication or ClusterTriggerAuthentication object that is used to authenticate the scaler with the environment
spec.scaledObjectSpec.triggers[].authenticationRef.kindstringNoNot specifiedKind of the resource being referred to. Defaults to TriggerAuthentication. enum: [“TriggerAuthentication”,“ClusterTriggerAuthentication”]
spec.scaledObjectSpec.triggers[].authenticationRef.namestringYesNot specified
spec.scaledObjectSpec.triggers[].metadataobjectYesNot specified
spec.scaledObjectSpec.triggers[].metadata.*stringNoNot specified
spec.scaledObjectSpec.triggers[].metricTypestringNoNot specifiedMetricTargetType specifies the type of metric being targeted, and should be either “Value”, “AverageValue”, or “Utilization”
spec.scaledObjectSpec.triggers[].namestringNoNot specified
spec.scaledObjectSpec.triggers[].typestringYesNot specifiedminLength: 1
spec.scaledObjectSpec.triggers[].useCachedMetricsbooleanNoNot specified
spec.totalTargetReplicasintegerNo0TotalTargetReplicas is the desired number of replicas
FieldTypeRequiredSchema defaultMeaning and validation
statusobjectNoNot specifiedDistributedScaledObjectStatus defines the observed state of DistributedScaledObject
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.memberClusterStatusesobjectNoNot specifiedMemberClusterStatuses represents the status of each member cluster
status.memberClusterStatuses.*objectNoNot specifiedDistributedScaledObjectMemberClusterStatus represents a member cluster status for DistributedScaledObject.
status.memberClusterStatuses.*.currentReplicasintegerYesNot specifiedCurrentReplicas is the current number of replicas in the member cluster
status.memberClusterStatuses.*.descriptionstringYesNot specifiedDescription provides additional information about the member cluster status
status.memberClusterStatuses.*.desiredReplicasintegerYesNot specifiedDesiredReplicas is the desired number of replicas in the member cluster
status.memberClusterStatuses.*.excludedbooleanNoNot specifiedExcluded indicates whether the member cluster is excluded from scaling for example, due to being unhealthy for longer than the grace period
status.memberClusterStatuses.*.idstringYesNot specifiedID is the identification of the member cluster for multicluster-controller
status.memberClusterStatuses.*.lastScalingProgressTimestringNoNot specifiedLastScalingProgressTime is the last time the scaling made progress This is used to determine how long the member cluster has been making slow progress for rebalancing purposes
status.memberClusterStatuses.*.lastStatusChangeTimestringNoNot specifiedLastStatusChangeTime is the last time the status changed This is used to determine how long the member cluster has been unhealthy for rebalancing purposes
status.memberClusterStatuses.*.providerstringNoNot specifiedProvider is the cluster provider type (for example file, kubeconfig)
status.memberClusterStatuses.*.statestringYesNot specifiedState is the state of the member cluster (e.g., Ready, NotReady)
status.membersHealthyCountintegerNoNot specifiedMembersHealthyCount is the number of healthy member clusters
status.membersTotalCountintegerNoNot specifiedMembersTotalCount is the total number of member clusters
status.printobjectNoNot specifiedPrint is used for custom printing of DistributedScaledObject status
status.print.membersCountstringNoNot specifiedMembersCountStatus is the status of member clusters
status.print.totalReplicasstringNoNot specifiedTotalReplicas represents the status of replicas across member clusters
status.selectorstringYesNot specifiedSelector is the selector for HPA
status.totalCurrentReplicasintegerYesNot specifiedTotalCurrentReplicas is the current number of replicas
Terminal window
kubectl get crd distributedscaledobjects.keda.kedify.io -o yaml
kubectl explain distributedscaledobject.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.

apiVersion: keda.kedify.io/v1alpha1
kind: DistributedScaledObject
metadata:
name: nginx
spec:
memberClusters: # optional list of member clusters to use, if omitted all registered member clusters will be used
- name: member-cluster-1
weight: 4 # weight determines the proportion of replicas to be allocated to this cluster
- name: member-cluster-2
weight: 6
rebalancingPolicy: # optional parameters for rebalancing replicas across member clusters in case of outage or issues
gracePeriod: 1m # when a member cluster becomes unreachable, wait for this duration before rebalancing replicas to other clusters
scaledObjectSpec: # standard ScaledObject spec
scaleTargetRef:
kind: Deployment
name: nginx
minReplicaCount: 1
maxReplicaCount: 10
triggers:
- type: kubernetes-resource
metadata:
resourceKind: ConfigMap
resourceName: mock-metric
key: metric-value
targetValue: "5"

In this example, the DistributedScaledObject named nginx is configured to scale a Deployment named nginx across two member clusters. The memberClusters field whitelists the member clusters to be used along with their respective weights, which determine how many replicas should be allocated to each cluster. This section is optional; if omitted, all registered member clusters will be used with equal weights.

The workloads of type Deployment are expected to be present in relevant member clusters in a matching namespace as the DistributedScaledObject.

The rebalancingPolicy field allows you to specify how to handle situations where a member cluster becomes unreachable. In this case, after the specified gracePeriod, the replicas that were allocated to the unreachable cluster will be redistributed among the remaining healthy clusters. Once the unreachable cluster becomes healthy again, the replicas will be rebalanced back according to the defined weights.

Status of the DistributedScaledObject provides insights into the scaling state across member clusters:

status:
memberClusterStatuses:
member-cluster-1:
currentReplicas: 2
description: Cluster is healthy
desiredReplicas: 2
id: /etc/mc/kubeconfigs/member-cluster-1.kubeconfig+kedify-agent@member-cluster-1
lastStatusChangeTime: "2025-11-05T16:46:39Z"
state: Ready
member-cluster-2:
currentReplicas: 3
description: Cluster is healthy
desiredReplicas: 3
id: /etc/mc/kubeconfigs/member-cluster-2.kubeconfig+kedify-agent@member-cluster-2
lastStatusChangeTime: "2025-11-05T15:45:44Z"
state: Ready
membersHealthyCount: 2
membersTotalCount: 2
selector: kedify-agent-distributedscaledobject=nginx
totalCurrentReplicas: 5