API Reference

v1.md Reference for placement.kubernetes-fleet.io KubeFleet APIs

placement.kubernetes-fleet.io/v1

Resource Types

Affinity

Affinity is a group of cluster affinity scheduling rules. More to be added.

Appears in:

FieldDescriptionDefaultValidation
clusterAffinity ClusterAffinityClusterAffinity contains cluster affinity scheduling rules for the selected resources.

AppliedResourceMeta

AppliedResourceMeta represents the group, version, resource, name and namespace of a resource. Since these resources have been created, they must have valid group, version, resource, namespace, and name.

Appears in:

FieldDescriptionDefaultValidation
ordinal integerOrdinal represents an index in manifests list, so the condition can still be linked
to a manifest even though manifest cannot be parsed successfully.
group stringGroup is the group of the resource.
version stringVersion is the version of the resource.
kind stringKind is the kind of the resource.
resource stringResource is the resource type of the resource
namespace stringNamespace is the namespace of the resource, the resource is cluster scoped if the value
is empty
name stringName is the name of the resource
uid UIDUID is set on successful deletion of the Kubernetes resource by controller. The
resource might be still visible on the managed cluster after this field is set.
It is not directly settable by a client.

AppliedWork

AppliedWork represents an applied work on managed cluster that is placed on a managed cluster. An appliedwork links to a work on a hub recording resources deployed in the managed cluster. When the agent is removed from managed cluster, cluster-admin on managed cluster can delete appliedwork to remove resources deployed by the agent. The name of the appliedwork must be the same as {work name} The namespace of the appliedwork should be the same as the resource applied on the managed cluster.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringplacement.kubernetes-fleet.io/v1
kind stringAppliedWork
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec AppliedWorkSpecSpec represents the desired configuration of AppliedWork.Required: {}
status AppliedWorkStatusStatus represents the current status of AppliedWork.

AppliedWorkList

AppliedWorkList contains a list of AppliedWork.

FieldDescriptionDefaultValidation
apiVersion stringplacement.kubernetes-fleet.io/v1
kind stringAppliedWorkList
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items AppliedWork arrayList of works.

AppliedWorkSpec

AppliedWorkSpec represents the desired configuration of AppliedWork.

Appears in:

FieldDescriptionDefaultValidation
workName stringWorkName represents the name of the related work on the hub.Required: {}
workNamespace stringWorkNamespace represents the namespace of the related work on the hub.Required: {}

AppliedWorkStatus

AppliedWorkStatus represents the current status of AppliedWork.

Appears in:

FieldDescriptionDefaultValidation
appliedResources AppliedResourceMeta arrayAppliedResources represents a list of resources defined within the Work that are applied.
Only resources with valid GroupVersionResource, namespace, and name are suitable.
An item in this slice is deleted when there is no mapped manifest in Work.Spec or by finalizer.
The resource relating to the item will also be removed from managed cluster.
The deleted resource may still be present until the finalizers for that resource are finished.
However, the resource will not be undeleted, so it can be removed from this list and eventual consistency is preserved.

ApplyStrategy

ApplyStrategy describes how to resolve the conflict if the resource to be placed already exists in the target cluster and whether it’s allowed to be co-owned by other non-fleet appliers. Note: If multiple CRPs try to place the same resource with different apply strategy, the later ones will fail with the reason ApplyConflictBetweenPlacements.

Appears in:

FieldDescriptionDefaultValidation
type ApplyStrategyTypeType defines the type of strategy to use. Default to ClientSideApply.
Server-side apply is a safer choice. Read more about the differences between server-side apply and client-side
apply: https://kubernetes.io/docs/reference/using-api/server-side-apply/#comparison-with-client-side-apply.
ClientSideApplyEnum: [ClientSideApply ServerSideApply]
allowCoOwnership booleanAllowCoOwnership defines whether to apply the resource if it already exists in the target cluster and is not
solely owned by fleet (i.e., metadata.ownerReferences contains only fleet custom resources).
If true, apply the resource and add fleet as a co-owner.
If false, leave the resource unchanged and fail the apply.
serverSideApplyConfig ServerSideApplyConfigServerSideApplyConfig defines the configuration for server side apply. It is honored only when type is ServerSideApply.

ApplyStrategyType

Underlying type: string

ApplyStrategyType describes the type of the strategy used to resolve the conflict if the resource to be placed already exists in the target cluster and is owned by other appliers.

Appears in:

FieldDescription
ClientSideApplyApplyStrategyTypeClientSideApply will use three-way merge patch similar to how kubectl apply does by storing
last applied state in the last-applied-configuration annotation.
When the last-applied-configuration annotation size is greater than 256kB, it falls back to the server-side apply.
ServerSideApplyApplyStrategyTypeServerSideApply will use server-side apply to resolve conflicts between the resource to be placed
and the existing resource in the target cluster.
Details: https://kubernetes.io/docs/reference/using-api/server-side-apply

BindingState

Underlying type: string

BindingState is the state of the binding.

Appears in:

FieldDescription
ScheduledBindingStateScheduled means the binding is scheduled but need to be bound to the target cluster.
BoundBindingStateBound means the binding is bound to the target cluster.
UnscheduledBindingStateUnscheduled means the binding is not scheduled on to the target cluster anymore.
This is a state that rollout controller cares about.
The work generator still treat this as bound until rollout controller deletes the binding.

ClusterAffinity

ClusterAffinity contains cluster affinity scheduling rules for the selected resources.

Appears in:

FieldDescriptionDefaultValidation
requiredDuringSchedulingIgnoredDuringExecution ClusterSelectorIf the affinity requirements specified by this field are not met at
scheduling time, the resource will not be scheduled onto the cluster.
If the affinity requirements specified by this field cease to be met
at some point after the placement (e.g. due to an update), the system
may or may not try to eventually remove the resource from the cluster.
preferredDuringSchedulingIgnoredDuringExecution PreferredClusterSelector arrayThe scheduler computes a score for each cluster at schedule time by iterating
through the elements of this field and adding “weight” to the sum if the cluster
matches the corresponding matchExpression. The scheduler then chooses the first
N clusters with the highest sum to satisfy the placement.
This field is ignored if the placement type is “PickAll”.
If the cluster score changes at some point after the placement (e.g. due to an update),
the system may or may not try to eventually move the resource from a cluster with a lower score
to a cluster with higher score.

ClusterDecision

ClusterDecision represents a decision from a placement An empty ClusterDecision indicates it is not scheduled yet.

Appears in:

FieldDescriptionDefaultValidation
clusterName stringClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all
placement decisions for the Placement.
Required: {}
selected booleanSelected indicates if this cluster is selected by the scheduler.
clusterScore ClusterScoreClusterScore represents the score of the cluster calculated by the scheduler.
reason stringReason represents the reason why the cluster is selected or not.

ClusterResourceBinding

ClusterResourceBinding represents a scheduling decision that binds a group of resources to a cluster. It MUST have a label named CRPTrackingLabel that points to the cluster resource policy that creates it.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringplacement.kubernetes-fleet.io/v1
kind stringClusterResourceBinding
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec ResourceBindingSpecThe desired state of ClusterResourceBinding.
status ResourceBindingStatusThe observed status of ClusterResourceBinding.

ClusterResourcePlacement

ClusterResourcePlacement is used to select cluster scoped resources, including built-in resources and custom resources, and placement them onto selected member clusters in a fleet.

If a namespace is selected, ALL the resources under the namespace are placed to the target clusters. Note that you can’t select the following resources:

  • reserved namespaces including: default, kube-* (reserved for Kubernetes system namespaces), fleet-* (reserved for fleet system namespaces).
  • reserved fleet resource types including: MemberCluster, InternalMemberCluster, ClusterResourcePlacement, ClusterSchedulingPolicySnapshot, ClusterResourceSnapshot, ClusterResourceBinding, etc.

ClusterSchedulingPolicySnapshot and ClusterResourceSnapshot objects are created when there are changes in the system to keep the history of the changes affecting a ClusterResourcePlacement.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringplacement.kubernetes-fleet.io/v1
kind stringClusterResourcePlacement
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec ClusterResourcePlacementSpecThe desired state of ClusterResourcePlacement.
status ClusterResourcePlacementStatusThe observed status of ClusterResourcePlacement.

ClusterResourcePlacementSpec

ClusterResourcePlacementSpec defines the desired state of ClusterResourcePlacement.

Appears in:

FieldDescriptionDefaultValidation
resourceSelectors ClusterResourceSelector arrayResourceSelectors is an array of selectors used to select cluster scoped resources. The selectors are ORed.
You can have 1-100 selectors.
MaxItems: 100
MinItems: 1
policy PlacementPolicyPolicy defines how to select member clusters to place the selected resources.
If unspecified, all the joined member clusters are selected.
strategy RolloutStrategyThe rollout strategy to use to replace existing placement with new ones.
revisionHistoryLimit integerThe number of old ClusterSchedulingPolicySnapshot or ClusterResourceSnapshot resources to retain to allow rollback.
This is a pointer to distinguish between explicit zero and not specified.
Defaults to 10.
10Maximum: 1000
Minimum: 1

ClusterResourcePlacementStatus

ClusterResourcePlacementStatus defines the observed state of the ClusterResourcePlacement object.

Appears in:

FieldDescriptionDefaultValidation
selectedResources ResourceIdentifier arraySelectedResources contains a list of resources selected by ResourceSelectors.
observedResourceIndex stringResource index logically represents the generation of the selected resources.
We take a new snapshot of the selected resources whenever the selection or their content change.
Each snapshot has a different resource index.
One resource snapshot can contain multiple clusterResourceSnapshots CRs in order to store large amount of resources.
To get clusterResourceSnapshot of a given resource index, use the following command:
kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex
ObservedResourceIndex is the resource index that the conditions in the ClusterResourcePlacementStatus observe.
For example, a condition of ClusterResourcePlacementWorkSynchronized type
is observing the synchronization status of the resource snapshot with the resource index $ObservedResourceIndex.
placementStatuses ResourcePlacementStatus arrayPlacementStatuses contains a list of placement status on the clusters that are selected by PlacementPolicy.
Each selected cluster according to the latest resource placement is guaranteed to have a corresponding placementStatuses.
In the pickN case, there are N placement statuses where N = NumberOfClusters; Or in the pickFixed case, there are
N placement statuses where N = ClusterNames.
In these cases, some of them may not have assigned clusters when we cannot fill the required number of clusters.
TODO, For pickAll type, considering providing unselected clusters info.
conditions Condition arrayConditions is an array of current observed conditions for ClusterResourcePlacement.

ClusterResourceSelector

ClusterResourceSelector is used to select cluster scoped resources as the target resources to be placed. If a namespace is selected, ALL the resources under the namespace are selected automatically. All the fields are ANDed. In other words, a resource must match all the fields to be selected.

Appears in:

FieldDescriptionDefaultValidation
group stringGroup name of the cluster-scoped resource.
Use an empty string to select resources under the core API group (e.g., namespaces).
version stringVersion of the cluster-scoped resource.
kind stringKind of the cluster-scoped resource.
Note: When Kind is namespace, ALL the resources under the selected namespaces are selected.
name stringName of the cluster-scoped resource.
labelSelector LabelSelectorA label query over all the cluster-scoped resources. Resources matching the query are selected.
Note that namespace-scoped resources can’t be selected even if they match the query.

ClusterResourceSnapshot

ClusterResourceSnapshot is used to store a snapshot of selected resources by a resource placement policy. Its spec is immutable. We may need to produce more than one resourceSnapshot for all the resources a ResourcePlacement selected to get around the 1MB size limit of k8s objects. We assign an ever-increasing index for each such group of resourceSnapshots. The naming convention of a clusterResourceSnapshot is {CRPName}-{resourceIndex}-{subindex} where the name of the first snapshot of a group has no subindex part so its name is {CRPName}-{resourceIndex}-snapshot. resourceIndex will begin with 0. Each snapshot MUST have the following labels:

  • CRPTrackingLabel which points to its owner CRP.
  • ResourceIndexLabel which is the index of the snapshot group.
  • IsLatestSnapshotLabel which indicates whether the snapshot is the latest one.

All the snapshots within the same index group must have the same ResourceIndexLabel.

The first snapshot of the index group MUST have the following annotations:

  • NumberOfResourceSnapshotsAnnotation to store the total number of resource snapshots in the index group.
  • ResourceGroupHashAnnotation whose value is the sha-256 hash of all the snapshots belong to the same snapshot index.

Each snapshot (excluding the first snapshot) MUST have the following annotations:

  • SubindexOfResourceSnapshotAnnotation to store the subindex of resource snapshot in the group.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringplacement.kubernetes-fleet.io/v1
kind stringClusterResourceSnapshot
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec ResourceSnapshotSpecThe desired state of ResourceSnapshot.
status ResourceSnapshotStatusThe observed status of ResourceSnapshot.

ClusterSchedulingPolicySnapshot

ClusterSchedulingPolicySnapshot is used to store a snapshot of cluster placement policy. Its spec is immutable. The naming convention of a ClusterSchedulingPolicySnapshot is {CRPName}-{PolicySnapshotIndex}. PolicySnapshotIndex will begin with 0. Each snapshot must have the following labels:

  • CRPTrackingLabel which points to its owner CRP.
  • PolicyIndexLabel which is the index of the policy snapshot.
  • IsLatestSnapshotLabel which indicates whether the snapshot is the latest one.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringplacement.kubernetes-fleet.io/v1
kind stringClusterSchedulingPolicySnapshot
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec SchedulingPolicySnapshotSpecThe desired state of SchedulingPolicySnapshot.
status SchedulingPolicySnapshotStatusThe observed status of SchedulingPolicySnapshot.

ClusterScore

ClusterScore represents the score of the cluster calculated by the scheduler.

Appears in:

FieldDescriptionDefaultValidation
affinityScore integerAffinityScore represents the affinity score of the cluster calculated by the last
scheduling decision based on the preferred affinity selector.
An affinity score may not present if the cluster does not meet the required affinity.
priorityScore integerTopologySpreadScore represents the priority score of the cluster calculated by the last
scheduling decision based on the topology spread applied to the cluster.
A priority score may not present if the cluster does not meet the topology spread.

ClusterSelector

Appears in:

FieldDescriptionDefaultValidation
clusterSelectorTerms ClusterSelectorTerm arrayClusterSelectorTerms is a list of cluster selector terms. The terms are ORed.MaxItems: 10

ClusterSelectorTerm

Underlying type: struct{LabelSelector *k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector “json:"labelSelector,omitempty"”; PropertySelector *PropertySelector “json:"propertySelector,omitempty"”; PropertySorter *PropertySorter “json:"propertySorter,omitempty"”}

Appears in:

EnvelopeIdentifier

EnvelopeIdentifier identifies the envelope object that contains the selected resource.

Appears in:

FieldDescriptionDefaultValidation
name stringName of the envelope object.
namespace stringNamespace is the namespace of the envelope object. Empty if the envelope object is cluster scoped.
type EnvelopeTypeType of the envelope object.ConfigMapEnum: [ConfigMap]

EnvelopeType

Underlying type: string

EnvelopeType defines the type of the envelope object.

Appears in:

FieldDescription
ConfigMapConfigMapEnvelopeType means the envelope object is of type ConfigMap.

FailedResourcePlacement

FailedResourcePlacement contains the failure details of a failed resource placement.

Appears in:

FieldDescriptionDefaultValidation
group stringGroup is the group name of the selected resource.
version stringVersion is the version of the selected resource.
kind stringKind represents the Kind of the selected resources.
name stringName of the target resource.
namespace stringNamespace is the namespace of the resource. Empty if the resource is cluster scoped.
envelope EnvelopeIdentifierEnvelope identifies the envelope object that contains this resource.
condition ConditionThe failed condition status.

Manifest

Manifest represents a resource to be deployed on spoke cluster.

Appears in:

ManifestCondition

ManifestCondition represents the conditions of the resources deployed on spoke cluster.

Appears in:

FieldDescriptionDefaultValidation
identifier WorkResourceIdentifierresourceId represents a identity of a resource linking to manifests in spec.
conditions Condition arrayConditions represents the conditions of this resource on spoke cluster

NamespacedName

NamespacedName comprises a resource name, with a mandatory namespace.

Appears in:

FieldDescriptionDefaultValidation
name stringName is the name of the namespaced scope resource.
namespace stringNamespace is namespace of the namespaced scope resource.

PlacementPolicy

PlacementPolicy contains the rules to select target member clusters to place the selected resources. Note that only clusters that are both joined and satisfying the rules will be selected.

You can only specify at most one of the two fields: ClusterNames and Affinity. If none is specified, all the joined clusters are selected.

Appears in:

FieldDescriptionDefaultValidation
placementType PlacementTypeType of placement. Can be “PickAll”, “PickN” or “PickFixed”. Default is PickAll.PickAllEnum: [PickAll PickN PickFixed]
clusterNames string arrayClusterNames contains a list of names of MemberCluster to place the selected resources.
Only valid if the placement type is “PickFixed”
MaxItems: 100
numberOfClusters integerNumberOfClusters of placement. Only valid if the placement type is “PickN”.Minimum: 0
affinity AffinityAffinity contains cluster affinity scheduling rules. Defines which member clusters to place the selected resources.
Only valid if the placement type is “PickAll” or “PickN”.
topologySpreadConstraints TopologySpreadConstraint arrayTopologySpreadConstraints describes how a group of resources ought to spread across multiple topology
domains. Scheduler will schedule resources in a way which abides by the constraints.
All topologySpreadConstraints are ANDed.
Only valid if the placement type is “PickN”.
tolerations Toleration arrayIf specified, the ClusterResourcePlacement’s Tolerations.
Tolerations cannot be updated or deleted.

This field is beta-level and is for the taints and tolerations feature.
MaxItems: 100

PlacementType

Underlying type: string

PlacementType identifies the type of placement.

Appears in:

FieldDescription
PickAllPickAllPlacementType picks all clusters that satisfy the rules.
PickNPickNPlacementType picks N clusters that satisfy the rules.
PickFixedPickFixedPlacementType picks a fixed set of clusters.

PreferredClusterSelector

Appears in:

FieldDescriptionDefaultValidation
weight integerWeight associated with matching the corresponding clusterSelectorTerm, in the range [-100, 100].Maximum: 100
Minimum: -100
preference ClusterSelectorTermA cluster selector term, associated with the corresponding weight.

PropertySelectorOperator

Underlying type: string

PropertySelectorOperator is the operator that can be used with PropertySelectorRequirements.

Appears in:

FieldDescription
GtPropertySelectorGreaterThan dictates Fleet to select cluster if its observed value of a given
property is greater than the value specified in the requirement.
GePropertySelectorGreaterThanOrEqualTo dictates Fleet to select cluster if its observed value
of a given property is greater than or equal to the value specified in the requirement.
EqPropertySelectorEqualTo dictates Fleet to select cluster if its observed value of a given
property is equal to the values specified in the requirement.
NePropertySelectorNotEqualTo dictates Fleet to select cluster if its observed value of a given
property is not equal to the values specified in the requirement.
LtPropertySelectorLessThan dictates Fleet to select cluster if its observed value of a given
property is less than the value specified in the requirement.
LePropertySelectorLessThanOrEqualTo dictates Fleet to select cluster if its observed value of a
given property is less than or equal to the value specified in the requirement.

PropertySelectorRequirement

PropertySelectorRequirement is a specific property requirement when picking clusters for resource placement.

Appears in:

FieldDescriptionDefaultValidation
name stringName is the name of the property; it should be a Kubernetes label name.
operator PropertySelectorOperatorOperator specifies the relationship between a cluster’s observed value of the specified
property and the values given in the requirement.
values string arrayValues are a list of values of the specified property which Fleet will compare against
the observed values of individual member clusters in accordance with the given
operator.

At this moment, each value should be a Kubernetes quantity. For more information, see
https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity.

If the operator is Gt (greater than), Ge (greater than or equal to), Lt (less than),
or Le (less than or equal to), Eq (equal to), or Ne (ne), exactly one value must be
specified in the list.
MaxItems: 1

PropertySortOrder

Underlying type: string

Appears in:

FieldDescription
DescendingDescending instructs Fleet to sort in descending order, that is, the clusters with higher
observed values of a property are most preferred and should have higher weights. We will
use linear scaling to calculate the weight for each cluster based on the observed values.
For example, with this order, if Fleet sorts all clusters by a specific property where the
observed values are in the range [10, 100], and a weight of 100 is specified;
Fleet will assign:
* a weight of 100 to the cluster with the maximum observed value (100); and
* a weight of 0 to the cluster with the minimum observed value (10); and
* a weight of 11 to the cluster with an observed value of 20.
It is calculated using the formula below:
((20 - 10)) / (100 - 10)) * 100 = 11
AscendingAscending instructs Fleet to sort in ascending order, that is, the clusters with lower
observed values are most preferred and should have higher weights. We will use linear scaling
to calculate the weight for each cluster based on the observed values.
For example, with this order, if Fleet sorts all clusters by a specific property where
the observed values are in the range [10, 100], and a weight of 100 is specified;
Fleet will assign:
* a weight of 0 to the cluster with the maximum observed value (100); and
* a weight of 100 to the cluster with the minimum observed value (10); and
* a weight of 89 to the cluster with an observed value of 20.
It is calculated using the formula below:
(1 - ((20 - 10) / (100 - 10))) * 100 = 89

ResourceBindingSpec

ResourceBindingSpec defines the desired state of ClusterResourceBinding.

Appears in:

FieldDescriptionDefaultValidation
state BindingStateThe desired state of the binding. Possible values: Scheduled, Bound, Unscheduled.
resourceSnapshotName stringResourceSnapshotName is the name of the resource snapshot that this resource binding points to.
If the resources are divided into multiple snapshots because of the resource size limit,
it points to the name of the leading snapshot of the index group.
resourceOverrideSnapshots NamespacedName arrayResourceOverrideSnapshots is a list of ResourceOverride snapshots associated with the selected resources.
clusterResourceOverrideSnapshots string arrayClusterResourceOverrides contains a list of applicable ClusterResourceOverride snapshot names associated with the
selected resources.
schedulingPolicySnapshotName stringSchedulingPolicySnapshotName is the name of the scheduling policy snapshot that this resource binding
points to; more specifically, the scheduler creates this bindings in accordance with this
scheduling policy snapshot.
targetCluster stringTargetCluster is the name of the cluster that the scheduler assigns the resources to.
clusterDecision ClusterDecisionClusterDecision explains why the scheduler selected this cluster.
applyStrategy ApplyStrategyApplyStrategy describes how to resolve the conflict if the resource to be placed already exists in the target cluster
and is owned by other appliers.
This field is a beta-level feature.

ResourceBindingStatus

ResourceBindingStatus represents the current status of a ClusterResourceBinding.

Appears in:

FieldDescriptionDefaultValidation
failedPlacements FailedResourcePlacement arrayFailedPlacements is a list of all the resources failed to be placed to the given cluster or the resource is unavailable.
Note that we only include 100 failed resource placements even if there are more than 100.
MaxItems: 100
conditions Condition arrayConditions is an array of current observed conditions for ClusterResourceBinding.

ResourceContent

ResourceContent contains the content of a resource

Appears in:

ResourceIdentifier

ResourceIdentifier identifies one Kubernetes resource.

Appears in:

FieldDescriptionDefaultValidation
group stringGroup is the group name of the selected resource.
version stringVersion is the version of the selected resource.
kind stringKind represents the Kind of the selected resources.
name stringName of the target resource.
namespace stringNamespace is the namespace of the resource. Empty if the resource is cluster scoped.
envelope EnvelopeIdentifierEnvelope identifies the envelope object that contains this resource.

ResourcePlacementStatus

ResourcePlacementStatus represents the placement status of selected resources for one target cluster.

Appears in:

FieldDescriptionDefaultValidation
clusterName stringClusterName is the name of the cluster this resource is assigned to.
If it is not empty, its value should be unique cross all placement decisions for the Placement.
applicableResourceOverrides NamespacedName arrayApplicableResourceOverrides contains a list of applicable ResourceOverride snapshots associated with the selected
resources.

This field is alpha-level and is for the override policy feature.
applicableClusterResourceOverrides string arrayApplicableClusterResourceOverrides contains a list of applicable ClusterResourceOverride snapshots associated with
the selected resources.

This field is alpha-level and is for the override policy feature.
failedPlacements FailedResourcePlacement arrayFailedPlacements is a list of all the resources failed to be placed to the given cluster or the resource is unavailable.
Note that we only include 100 failed resource placements even if there are more than 100.
This field is only meaningful if the ClusterName is not empty.
MaxItems: 100
conditions Condition arrayConditions is an array of current observed conditions for ResourcePlacementStatus.

ResourceSnapshotSpec

ResourceSnapshotSpec defines the desired state of ResourceSnapshot.

Appears in:

FieldDescriptionDefaultValidation
selectedResources ResourceContent arraySelectedResources contains a list of resources selected by ResourceSelectors.

ResourceSnapshotStatus

Appears in:

FieldDescriptionDefaultValidation
conditions Condition arrayConditions is an array of current observed conditions for ResourceSnapshot.

RollingUpdateConfig

RollingUpdateConfig contains the config to control the desired behavior of rolling update.

Appears in:

FieldDescriptionDefaultValidation
maxUnavailable IntOrStringThe maximum number of clusters that can be unavailable during the rolling update
comparing to the desired number of clusters.
The desired number equals to the NumberOfClusters field when the placement type is PickN.
The desired number equals to the number of clusters scheduler selected when the placement type is PickAll.
Value can be an absolute number (ex: 5) or a percentage of the desired number of clusters (ex: 10%).
Absolute number is calculated from percentage by rounding up.
We consider a resource unavailable when we either remove it from a cluster or in-place
upgrade the resources content on the same cluster.
The minimum of MaxUnavailable is 0 to allow no downtime moving a placement from one cluster to another.
Please set it to be greater than 0 to avoid rolling out stuck during in-place resource update.
Defaults to 25%.
25%Pattern: ^((100|[0-9]\{1,2\})%|[0-9]+)$
XIntOrString: {}
maxSurge IntOrStringThe maximum number of clusters that can be scheduled above the desired number of clusters.
The desired number equals to the NumberOfClusters field when the placement type is PickN.
The desired number equals to the number of clusters scheduler selected when the placement type is PickAll.
Value can be an absolute number (ex: 5) or a percentage of desire (ex: 10%).
Absolute number is calculated from percentage by rounding up.
This does not apply to the case that we do in-place update of resources on the same cluster.
This can not be 0 if MaxUnavailable is 0.
Defaults to 25%.
25%Pattern: ^((100|[0-9]\{1,2\})%|[0-9]+)$
XIntOrString: {}
unavailablePeriodSeconds integerUnavailablePeriodSeconds is used to configure the waiting time between rollout phases when we
cannot determine if the resources have rolled out successfully or not.
We have a built-in resource state detector to determine the availability status of following well-known Kubernetes
native resources: Deployment, StatefulSet, DaemonSet, Service, Namespace, ConfigMap, Secret,
ClusterRole, ClusterRoleBinding, Role, RoleBinding.
Please see Safe Rollout for more details.
For other types of resources, we consider them as available after UnavailablePeriodSeconds seconds
have passed since they were successfully applied to the target cluster.
Default is 60.
60

RolloutStrategy

RolloutStrategy describes how to roll out a new change in selected resources to target clusters.

Appears in:

FieldDescriptionDefaultValidation
type RolloutStrategyTypeType of rollout. The only supported type is “RollingUpdate”. Default is “RollingUpdate”.RollingUpdateEnum: [RollingUpdate]
rollingUpdate RollingUpdateConfigRolling update config params. Present only if RolloutStrategyType = RollingUpdate.
applyStrategy ApplyStrategyApplyStrategy describes how to resolve the conflict if the resource to be placed already exists in the target cluster
and is owned by other appliers.
This field is a beta-level feature.

RolloutStrategyType

Underlying type: string

Appears in:

FieldDescription
RollingUpdateRollingUpdateRolloutStrategyType replaces the old placed resource using rolling update
i.e. gradually create the new one while replace the old ones.

SchedulingPolicySnapshotSpec

SchedulingPolicySnapshotSpec defines the desired state of SchedulingPolicySnapshot.

Appears in:

FieldDescriptionDefaultValidation
policy PlacementPolicyPolicy defines how to select member clusters to place the selected resources.
If unspecified, all the joined member clusters are selected.
policyHash integer arrayPolicyHash is the sha-256 hash value of the Policy field.

SchedulingPolicySnapshotStatus

SchedulingPolicySnapshotStatus defines the observed state of SchedulingPolicySnapshot.

Appears in:

FieldDescriptionDefaultValidation
observedCRPGeneration integerObservedCRPGeneration is the generation of the CRP which the scheduler uses to perform
the scheduling cycle and prepare the scheduling status.
conditions Condition arrayConditions is an array of current observed conditions for SchedulingPolicySnapshot.
targetClusters ClusterDecision arrayClusterDecisions contains a list of names of member clusters considered by the scheduler.
Note that all the selected clusters must present in the list while not all the
member clusters are guaranteed to be listed due to the size limit. We will try to
add the clusters that can provide the most insight to the list first.
MaxItems: 1000

ServerSideApplyConfig

ServerSideApplyConfig defines the configuration for server side apply. Details: https://kubernetes.io/docs/reference/using-api/server-side-apply/#conflicts

Appears in:

FieldDescriptionDefaultValidation
force booleanForce represents to force apply to succeed when resolving the conflicts
For any conflicting fields,
- If true, use the values from the resource to be applied to overwrite the values of the existing resource in the
target cluster, as well as take over ownership of such fields.
- If false, apply will fail with the reason ApplyConflictWithOtherApplier.

For non-conflicting fields, values stay unchanged and ownership are shared between appliers.

Toleration

Toleration allows ClusterResourcePlacement to tolerate any taint that matches the triple <key,value,effect> using the matching operator .

Appears in:

FieldDescriptionDefaultValidation
key stringKey is the taint key that the toleration applies to. Empty means match all taint keys.
If the key is empty, operator must be Exists; this combination means to match all values and all keys.
operator TolerationOperatorOperator represents a key’s relationship to the value.
Valid operators are Exists and Equal. Defaults to Equal.
Exists is equivalent to wildcard for value, so that a
ClusterResourcePlacement can tolerate all taints of a particular category.
EqualEnum: [Equal Exists]
value stringValue is the taint value the toleration matches to.
If the operator is Exists, the value should be empty, otherwise just a regular string.
effect TaintEffectEffect indicates the taint effect to match. Empty means match all taint effects.
When specified, only allowed value is NoSchedule.
Enum: [NoSchedule]

TopologySpreadConstraint

TopologySpreadConstraint specifies how to spread resources among the given cluster topology.

Appears in:

FieldDescriptionDefaultValidation
maxSkew integerMaxSkew describes the degree to which resources may be unevenly distributed.
When whenUnsatisfiable=DoNotSchedule, it is the maximum permitted difference
between the number of resource copies in the target topology and the global minimum.
The global minimum is the minimum number of resource copies in a domain.
When whenUnsatisfiable=ScheduleAnyway, it is used to give higher precedence
to topologies that satisfy it.
It’s an optional field. Default value is 1 and 0 is not allowed.
1Minimum: 1
topologyKey stringTopologyKey is the key of cluster labels. Clusters that have a label with this key
and identical values are considered to be in the same topology.
We consider each <key, value> as a “bucket”, and try to put balanced number
of replicas of the resource into each bucket honor the MaxSkew value.
It’s a required field.
whenUnsatisfiable UnsatisfiableConstraintActionWhenUnsatisfiable indicates how to deal with the resource if it doesn’t satisfy
the spread constraint.
- DoNotSchedule (default) tells the scheduler not to schedule it.
- ScheduleAnyway tells the scheduler to schedule the resource in any cluster,
but giving higher precedence to topologies that would help reduce the skew.
It’s an optional field.

UnsatisfiableConstraintAction

Underlying type: string

UnsatisfiableConstraintAction defines the type of actions that can be taken if a constraint is not satisfied.

Appears in:

FieldDescription
DoNotScheduleDoNotSchedule instructs the scheduler not to schedule the resource
onto the cluster when constraints are not satisfied.
ScheduleAnywayScheduleAnyway instructs the scheduler to schedule the resource
even if constraints are not satisfied.

Work

Work is the Schema for the works API.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringplacement.kubernetes-fleet.io/v1
kind stringWork
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec WorkSpecspec defines the workload of a work.
status WorkStatusstatus defines the status of each applied manifest on the spoke cluster.

WorkList

WorkList contains a list of Work.

FieldDescriptionDefaultValidation
apiVersion stringplacement.kubernetes-fleet.io/v1
kind stringWorkList
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items Work arrayList of works.

WorkResourceIdentifier

WorkResourceIdentifier provides the identifiers needed to interact with any arbitrary object. Renamed original “ResourceIdentifier” so that it won’t conflict with ResourceIdentifier defined in the clusterresourceplacement_types.go.

Appears in:

FieldDescriptionDefaultValidation
ordinal integerOrdinal represents an index in manifests list, so the condition can still be linked
to a manifest even though manifest cannot be parsed successfully.
group stringGroup is the group of the resource.
version stringVersion is the version of the resource.
kind stringKind is the kind of the resource.
resource stringResource is the resource type of the resource
namespace stringNamespace is the namespace of the resource, the resource is cluster scoped if the value
is empty
name stringName is the name of the resource

WorkSpec

WorkSpec defines the desired state of Work.

Appears in:

FieldDescriptionDefaultValidation
workload WorkloadTemplateWorkload represents the manifest workload to be deployed on spoke cluster
applyStrategy ApplyStrategyApplyStrategy describes how to resolve the conflict if the resource to be placed already exists in the target cluster
and is owned by other appliers.
This field is a beta-level feature.

WorkStatus

WorkStatus defines the observed state of Work.

Appears in:

FieldDescriptionDefaultValidation
conditions Condition arrayConditions contains the different condition statuses for this work.
Valid condition types are:
1. Applied represents workload in Work is applied successfully on the spoke cluster.
2. Progressing represents workload in Work in the transitioning from one state to another the on the spoke cluster.
3. Available represents workload in Work exists on the spoke cluster.
4. Degraded represents the current state of workload does not match the desired
state for a certain period.
manifestConditions ManifestCondition arrayManifestConditions represents the conditions of each resource in work deployed on
spoke cluster.

WorkloadTemplate

WorkloadTemplate represents the manifest workload to be deployed on spoke cluster

Appears in:

FieldDescriptionDefaultValidation
manifests Manifest arrayManifests represents a list of kubernetes resources to be deployed on the spoke cluster.