Skip to content
3 changes: 3 additions & 0 deletions apis/placement/v1beta1/binding_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ type ResourceBindingSpec struct {

// TargetCluster is the name of the cluster that the scheduler assigns the resources to.
TargetCluster string `json:"targetCluster"`

// ClusterDecision explains why the scheduler makes this binding.
ClusterDecision ClusterDecision `json:"clusterDecision"`
}

// ResourceBindingStatus represents the current status of a ClusterResourceBinding.
Expand Down
5 changes: 5 additions & 0 deletions apis/placement/v1beta1/policysnapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const (

// PolicySnapshotNameFmt is clusterPolicySnapshot name format: {CRPName}-{PolicySnapshotIndex}.
PolicySnapshotNameFmt = "%s-%d"

// NumOfClustersAnnotation is an annotation that indicates the desired number of clusters where
// the selected resources should be placed. It is annotated on policy snapshots and is sync'd
// from the CRP to the currently active policy snapshot.
NumOfClustersAnnotation = fleetPrefix + "numOfClusters"
)

// +genclient
Expand Down
2 changes: 1 addition & 1 deletion apis/placement/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions config/crd/bases/placement.karavel.io_clusterresourcebindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,48 @@ spec:
spec:
description: The desired state of ClusterResourceBinding.
properties:
clusterDecision:
description: ClusterDecision explains why the scheduler makes this
binding.
properties:
clusterName:
description: ClusterName is the name of the ManagedCluster. If
it is not empty, its value should be unique cross all placement
decisions for the Placement.
type: string
clusterScore:
description: ClusterScore represents the score of the cluster
calculated by the scheduler.
properties:
affinityScore:
description: AffinityScore 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.
format: int32
type: integer
priorityScore:
description: TopologySpreadScore 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.
format: int32
type: integer
type: object
reason:
description: Reason represents the reason why the cluster is selected
or not.
type: string
selected:
description: Selected indicates if this cluster is selected by
the scheduler.
type: boolean
required:
- clusterName
- reason
- selected
type: object
resourceSnapshotName:
description: ResourceSnapshotName is the name of the resource snapshot
that this resource binding points to. If the resources are divided
Expand All @@ -58,6 +100,7 @@ spec:
assigns the resources to.
type: string
required:
- clusterDecision
- resourceSnapshotName
- targetCluster
type: object
Expand Down
Loading