Documentation ¶
Overview ¶
+kubebuilder:object:generate=true +k8s:deepcopy-gen=package,register +groupName=placement.kubernetes-fleet.io
+kubebuilder:object:generate=true +groupName=placement.kubernetes-fleet.io
Index ¶
- Constants
- Variables
- type Affinity
- type AppliedResourceMeta
- type AppliedWork
- type AppliedWorkList
- type AppliedWorkSpec
- type AppliedWorkStatus
- type ApplyStrategy
- type ApplyStrategyType
- type BindingState
- type ClusterAffinity
- type ClusterDecision
- type ClusterResourceBinding
- func (in *ClusterResourceBinding) DeepCopy() *ClusterResourceBinding
- func (in *ClusterResourceBinding) DeepCopyInto(out *ClusterResourceBinding)
- func (in *ClusterResourceBinding) DeepCopyObject() runtime.Object
- func (m *ClusterResourceBinding) GetCondition(conditionType string) *metav1.Condition
- func (m *ClusterResourceBinding) SetConditions(conditions ...metav1.Condition)
- type ClusterResourceBindingList
- type ClusterResourcePlacement
- func (in *ClusterResourcePlacement) DeepCopy() *ClusterResourcePlacement
- func (in *ClusterResourcePlacement) DeepCopyInto(out *ClusterResourcePlacement)
- func (in *ClusterResourcePlacement) DeepCopyObject() runtime.Object
- func (m *ClusterResourcePlacement) GetCondition(conditionType string) *metav1.Condition
- func (m *ClusterResourcePlacement) SetConditions(conditions ...metav1.Condition)
- func (m *ClusterResourcePlacement) Tolerations() []Toleration
- type ClusterResourcePlacementConditionType
- type ClusterResourcePlacementList
- type ClusterResourcePlacementSpec
- type ClusterResourcePlacementStatus
- type ClusterResourceSelector
- type ClusterResourceSnapshot
- func (in *ClusterResourceSnapshot) DeepCopy() *ClusterResourceSnapshot
- func (in *ClusterResourceSnapshot) DeepCopyInto(out *ClusterResourceSnapshot)
- func (in *ClusterResourceSnapshot) DeepCopyObject() runtime.Object
- func (m *ClusterResourceSnapshot) GetCondition(conditionType string) *metav1.Condition
- func (m *ClusterResourceSnapshot) SetConditions(conditions ...metav1.Condition)
- type ClusterResourceSnapshotList
- type ClusterSchedulingPolicySnapshot
- func (in *ClusterSchedulingPolicySnapshot) DeepCopy() *ClusterSchedulingPolicySnapshot
- func (in *ClusterSchedulingPolicySnapshot) DeepCopyInto(out *ClusterSchedulingPolicySnapshot)
- func (in *ClusterSchedulingPolicySnapshot) DeepCopyObject() runtime.Object
- func (m *ClusterSchedulingPolicySnapshot) GetCondition(conditionType string) *metav1.Condition
- func (m *ClusterSchedulingPolicySnapshot) SetConditions(conditions ...metav1.Condition)
- func (m *ClusterSchedulingPolicySnapshot) Tolerations() []Toleration
- type ClusterSchedulingPolicySnapshotList
- type ClusterScore
- type ClusterSelector
- type ClusterSelectorTerm
- type EnvelopeIdentifier
- type EnvelopeType
- type FailedResourcePlacement
- type Manifest
- type ManifestCondition
- type NamespacedName
- type PlacementPolicy
- type PlacementType
- type PreferredClusterSelector
- type PropertySelector
- type PropertySelectorOperator
- type PropertySelectorRequirement
- type PropertySortOrder
- type PropertySorter
- type ResourceBindingConditionType
- type ResourceBindingSpec
- type ResourceBindingStatus
- type ResourceContent
- type ResourceIdentifier
- type ResourcePlacementConditionType
- type ResourcePlacementStatus
- type ResourceSnapshotSpec
- type ResourceSnapshotStatus
- type RollingUpdateConfig
- type RolloutStrategy
- type RolloutStrategyType
- type SchedulingPolicySnapshotConditionType
- type SchedulingPolicySnapshotSpec
- type SchedulingPolicySnapshotStatus
- type ServerSideApplyConfig
- type Toleration
- type TopologySpreadConstraint
- type UnsatisfiableConstraintAction
- type Work
- type WorkList
- type WorkResourceIdentifier
- type WorkSpec
- type WorkStatus
- type WorkloadTemplate
Constants ¶
const ( // ClusterResourcePlacementCleanupFinalizer is a finalizer added by the CRP controller to all CRPs, to make sure // that the CRP controller can react to CRP deletions if necessary. ClusterResourcePlacementCleanupFinalizer = fleetPrefix + "crp-cleanup" // SchedulerCRPCleanupFinalizer is a finalizer addd by the scheduler to CRPs, to make sure // that all bindings derived from a CRP can be cleaned up after the CRP is deleted. SchedulerCRPCleanupFinalizer = fleetPrefix + "scheduler-cleanup" )
const ( ClusterResourcePlacementKind = "ClusterResourcePlacement" ClusterResourcePlacementResource = "clusterresourceplacements" ClusterResourceBindingKind = "ClusterResourceBinding" ClusterResourceSnapshotKind = "ClusterResourceSnapshot" ClusterSchedulingPolicySnapshotKind = "ClusterSchedulingPolicySnapshot" WorkKind = "Work" AppliedWorkKind = "AppliedWork" )
const ( // MemberClusterFinalizer is used to make sure that we handle gc of all the member cluster resources on the hub cluster. MemberClusterFinalizer = fleetPrefix + "membercluster-finalizer" // WorkFinalizer is used by the work generator to make sure that the binding is not deleted until the work objects // it generates are all deleted, or used by the work controller to make sure the work has been deleted in the member // cluster. WorkFinalizer = fleetPrefix + "work-cleanup" // CRPTrackingLabel is the label that points to the cluster resource policy that creates a resource binding. CRPTrackingLabel = fleetPrefix + "parent-CRP" // IsLatestSnapshotLabel tells if the snapshot is the latest one. IsLatestSnapshotLabel = fleetPrefix + "is-latest-snapshot" // FleetResourceLabelKey is that label that indicates the resource is a fleet resource. FleetResourceLabelKey = fleetPrefix + "is-fleet-resource" // FirstWorkNameFmt is the format of the name of the work generated with first resource snapshot . // The name of the first work is {crpName}-work. FirstWorkNameFmt = "%s-work" // WorkNameWithSubindexFmt is the format of the name of a work generated with resource snapshot with subindex. // The name of the first work is {crpName}-{subindex}. WorkNameWithSubindexFmt = "%s-%d" // WorkNameWithConfigEnvelopeFmt is the format of the name of a work generated with config envelop. // The format is {workPrefix}-configMap-uuid WorkNameWithConfigEnvelopeFmt = "%s-configmap-%s" // ParentResourceSnapshotIndexLabel is the label applied to work that contains the index of the resource snapshot that generates the work. ParentResourceSnapshotIndexLabel = fleetPrefix + "parent-resource-snapshot-index" // ParentBindingLabel is the label applied to work that contains the name of the binding that generates the work. ParentBindingLabel = fleetPrefix + "parent-resource-binding" // CRPGenerationAnnotation is the annotation that indicates the generation of the CRP from // which an object is derived or last updated. CRPGenerationAnnotation = fleetPrefix + "CRP-generation" // EnvelopeConfigMapAnnotation is the annotation that indicates the configmap is an envelope configmap that contains resources // we need to apply to the member cluster instead of the configMap itself. EnvelopeConfigMapAnnotation = fleetPrefix + "envelope-configmap" // EnvelopeTypeLabel is the label that marks the work object as generated from an envelope object. // The value of the annotation is the type of the envelope object. EnvelopeTypeLabel = fleetPrefix + "envelope-work" // EnvelopeNamespaceLabel is the label that contains the namespace of the envelope object that the work is generated from. EnvelopeNamespaceLabel = fleetPrefix + "envelope-namespace" // EnvelopeNameLabel is the label that contains the name of the envelope object that the work is generated from. EnvelopeNameLabel = fleetPrefix + "envelope-name" // PreviousBindingStateAnnotation is the annotation that records the previous state of a binding. // This is used to remember if an "unscheduled" binding was moved from a "bound" state or a "scheduled" state. PreviousBindingStateAnnotation = fleetPrefix + "previous-binding-state" )
const ( // PolicyIndexLabel is the label that indicate the policy snapshot index of a cluster policy. PolicyIndexLabel = fleetPrefix + "policy-index" // PolicySnapshotNameFmt is clusterPolicySnapshot name format: {CRPName}-{PolicySnapshotIndex}. PolicySnapshotNameFmt = "%s-%d" // NumberOfClustersAnnotation is the annotation that indicates how many clusters should be selected for selectN placement type. NumberOfClustersAnnotation = fleetPrefix + "number-of-clusters" )
const ( // ResourceIndexLabel is the label that indicate the resource snapshot index of a cluster resource snapshot. ResourceIndexLabel = fleetPrefix + "resource-index" // ResourceGroupHashAnnotation is the annotation that contains the value of the sha-256 hash // value of all the snapshots belong to the same snapshot index. ResourceGroupHashAnnotation = fleetPrefix + "resource-hash" // NumberOfEnvelopedObjectsAnnotation is the annotation that contains the number of the enveloped objects in the resource snapshot group. NumberOfEnvelopedObjectsAnnotation = fleetPrefix + "number-of-enveloped-object" // NumberOfResourceSnapshotsAnnotation is the annotation that contains the total number of resource snapshots. NumberOfResourceSnapshotsAnnotation = fleetPrefix + "number-of-resource-snapshots" // SubindexOfResourceSnapshotAnnotation is the annotation to store the subindex of resource snapshot in the group. SubindexOfResourceSnapshotAnnotation = fleetPrefix + "subindex-of-resource-snapshot" // ResourceSnapshotNameFmt is resourcePolicySnapshot name format: {CRPName}-{resourceIndex}-snapshot. ResourceSnapshotNameFmt = "%s-%d-snapshot" // ResourceSnapshotNameWithSubindexFmt is resourcePolicySnapshot name with subindex format: {CRPName}-{resourceIndex}-{subindex}. ResourceSnapshotNameWithSubindexFmt = "%s-%d-%d" )
const ( // ManifestHashAnnotation is the annotation that indicates whether the spec of the object has been changed or not. ManifestHashAnnotation = fleetPrefix + "spec-hash" // LastAppliedConfigAnnotation is to record the last applied configuration on the object. LastAppliedConfigAnnotation = fleetPrefix + "last-applied-configuration" // WorkConditionTypeApplied represents workload in Work is applied successfully on the spoke cluster. WorkConditionTypeApplied = "Applied" // WorkConditionTypeAvailable represents workload in Work is available on the spoke cluster. WorkConditionTypeAvailable = "Available" )
The following definitions are originally declared in the controllers/workv1alpha1/manager.go file.
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "placement.kubernetes-fleet.io", Version: "v1beta1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
This section is empty.
Types ¶
type Affinity ¶
type Affinity struct { // ClusterAffinity contains cluster affinity scheduling rules for the selected resources. // +optional ClusterAffinity *ClusterAffinity `json:"clusterAffinity,omitempty"` }
Affinity is a group of cluster affinity scheduling rules. More to be added.
func (*Affinity) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Affinity.
func (*Affinity) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AppliedResourceMeta ¶ added in v0.6.9
type AppliedResourceMeta struct { WorkResourceIdentifier `json:",inline"` // UID 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. // +optional UID types.UID `json:"uid,omitempty"` }
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.
func (*AppliedResourceMeta) DeepCopy ¶ added in v0.6.9
func (in *AppliedResourceMeta) DeepCopy() *AppliedResourceMeta
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppliedResourceMeta.
func (*AppliedResourceMeta) DeepCopyInto ¶ added in v0.6.9
func (in *AppliedResourceMeta) DeepCopyInto(out *AppliedResourceMeta)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AppliedWork ¶ added in v0.6.9
type AppliedWork struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec represents the desired configuration of AppliedWork. // +kubebuilder:validation:Required // +required Spec AppliedWorkSpec `json:"spec"` // Status represents the current status of AppliedWork. // +optional Status AppliedWorkStatus `json:"status,omitempty"` }
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.
func (*AppliedWork) DeepCopy ¶ added in v0.6.9
func (in *AppliedWork) DeepCopy() *AppliedWork
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppliedWork.
func (*AppliedWork) DeepCopyInto ¶ added in v0.6.9
func (in *AppliedWork) DeepCopyInto(out *AppliedWork)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*AppliedWork) DeepCopyObject ¶ added in v0.6.9
func (in *AppliedWork) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type AppliedWorkList ¶ added in v0.6.9
type AppliedWorkList struct { metav1.TypeMeta `json:",inline"` // Standard list metadata. // +optional metav1.ListMeta `json:"metadata,omitempty"` // List of works. // +listType=set Items []AppliedWork `json:"items"` }
AppliedWorkList contains a list of AppliedWork.
func (*AppliedWorkList) DeepCopy ¶ added in v0.6.9
func (in *AppliedWorkList) DeepCopy() *AppliedWorkList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppliedWorkList.
func (*AppliedWorkList) DeepCopyInto ¶ added in v0.6.9
func (in *AppliedWorkList) DeepCopyInto(out *AppliedWorkList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*AppliedWorkList) DeepCopyObject ¶ added in v0.6.9
func (in *AppliedWorkList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type AppliedWorkSpec ¶ added in v0.6.9
type AppliedWorkSpec struct { // WorkName represents the name of the related work on the hub. // +kubebuilder:validation:Required // +required WorkName string `json:"workName"` // WorkNamespace represents the namespace of the related work on the hub. // +kubebuilder:validation:Required // +required WorkNamespace string `json:"workNamespace"` }
AppliedWorkSpec represents the desired configuration of AppliedWork.
func (*AppliedWorkSpec) DeepCopy ¶ added in v0.6.9
func (in *AppliedWorkSpec) DeepCopy() *AppliedWorkSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppliedWorkSpec.
func (*AppliedWorkSpec) DeepCopyInto ¶ added in v0.6.9
func (in *AppliedWorkSpec) DeepCopyInto(out *AppliedWorkSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AppliedWorkStatus ¶ added in v0.6.9
type AppliedWorkStatus struct { // AppliedResources 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. // +optional AppliedResources []AppliedResourceMeta `json:"appliedResources,omitempty"` }
AppliedWorkStatus represents the current status of AppliedWork.
func (*AppliedWorkStatus) DeepCopy ¶ added in v0.6.9
func (in *AppliedWorkStatus) DeepCopy() *AppliedWorkStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppliedWorkStatus.
func (*AppliedWorkStatus) DeepCopyInto ¶ added in v0.6.9
func (in *AppliedWorkStatus) DeepCopyInto(out *AppliedWorkStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ApplyStrategy ¶ added in v0.8.7
type ApplyStrategy struct { // Type 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. // +kubebuilder:default=ClientSideApply // +kubebuilder:validation:Enum=ClientSideApply;ServerSideApply // +optional Type ApplyStrategyType `json:"type,omitempty"` // AllowCoOwnership 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. AllowCoOwnership bool `json:"allowCoOwnership,omitempty"` // ServerSideApplyConfig defines the configuration for server side apply. It is honored only when type is ServerSideApply. // +optional ServerSideApplyConfig *ServerSideApplyConfig `json:"serverSideApplyConfig,omitempty"` }
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.
func (*ApplyStrategy) DeepCopy ¶ added in v0.8.7
func (in *ApplyStrategy) DeepCopy() *ApplyStrategy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplyStrategy.
func (*ApplyStrategy) DeepCopyInto ¶ added in v0.8.7
func (in *ApplyStrategy) DeepCopyInto(out *ApplyStrategy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ApplyStrategyType ¶ added in v0.8.7
type ApplyStrategyType 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. +enum
const ( // ApplyStrategyTypeClientSideApply 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. ApplyStrategyTypeClientSideApply ApplyStrategyType = "ClientSideApply" // ApplyStrategyTypeServerSideApply 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 ApplyStrategyTypeServerSideApply ApplyStrategyType = "ServerSideApply" )
type BindingState ¶
type BindingState string
BindingState is the state of the binding.
const ( // BindingStateScheduled means the binding is scheduled but need to be bound to the target cluster. BindingStateScheduled BindingState = "Scheduled" // BindingStateBound means the binding is bound to the target cluster. BindingStateBound BindingState = "Bound" // BindingStateUnscheduled 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. BindingStateUnscheduled BindingState = "Unscheduled" )
type ClusterAffinity ¶
type ClusterAffinity struct { // If 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. // +optional RequiredDuringSchedulingIgnoredDuringExecution *ClusterSelector `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` // The 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. // +optional PreferredDuringSchedulingIgnoredDuringExecution []PreferredClusterSelector `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` }
ClusterAffinity contains cluster affinity scheduling rules for the selected resources.
func (*ClusterAffinity) DeepCopy ¶
func (in *ClusterAffinity) DeepCopy() *ClusterAffinity
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAffinity.
func (*ClusterAffinity) DeepCopyInto ¶
func (in *ClusterAffinity) DeepCopyInto(out *ClusterAffinity)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterDecision ¶
type ClusterDecision struct { // ClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all // placement decisions for the Placement. // +kubebuilder:validation:Required // +required ClusterName string `json:"clusterName"` // Selected indicates if this cluster is selected by the scheduler. // +required Selected bool `json:"selected"` // ClusterScore represents the score of the cluster calculated by the scheduler. // +optional ClusterScore *ClusterScore `json:"clusterScore"` // Reason represents the reason why the cluster is selected or not. // +required Reason string `json:"reason"` }
ClusterDecision represents a decision from a placement An empty ClusterDecision indicates it is not scheduled yet.
func (*ClusterDecision) DeepCopy ¶
func (in *ClusterDecision) DeepCopy() *ClusterDecision
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDecision.
func (*ClusterDecision) DeepCopyInto ¶
func (in *ClusterDecision) DeepCopyInto(out *ClusterDecision)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterResourceBinding ¶
type ClusterResourceBinding struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // The desired state of ClusterResourceBinding. // +required Spec ResourceBindingSpec `json:"spec"` // The observed status of ClusterResourceBinding. // +optional Status ResourceBindingStatus `json:"status,omitempty"` }
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.
func (*ClusterResourceBinding) DeepCopy ¶
func (in *ClusterResourceBinding) DeepCopy() *ClusterResourceBinding
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceBinding.
func (*ClusterResourceBinding) DeepCopyInto ¶
func (in *ClusterResourceBinding) DeepCopyInto(out *ClusterResourceBinding)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterResourceBinding) DeepCopyObject ¶
func (in *ClusterResourceBinding) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ClusterResourceBinding) GetCondition ¶
func (m *ClusterResourceBinding) GetCondition(conditionType string) *metav1.Condition
GetCondition returns the condition of the given ClusterResourceBinding.
func (*ClusterResourceBinding) SetConditions ¶
func (m *ClusterResourceBinding) SetConditions(conditions ...metav1.Condition)
SetConditions set the given conditions on the ClusterResourceBinding.
type ClusterResourceBindingList ¶
type ClusterResourceBindingList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` // items is the list of ClusterResourceBindings. Items []ClusterResourceBinding `json:"items"` }
ClusterResourceBindingList is a collection of ClusterResourceBinding. +kubebuilder:resource:scope="Cluster" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*ClusterResourceBindingList) DeepCopy ¶
func (in *ClusterResourceBindingList) DeepCopy() *ClusterResourceBindingList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceBindingList.
func (*ClusterResourceBindingList) DeepCopyInto ¶
func (in *ClusterResourceBindingList) DeepCopyInto(out *ClusterResourceBindingList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterResourceBindingList) DeepCopyObject ¶
func (in *ClusterResourceBindingList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterResourcePlacement ¶
type ClusterResourcePlacement struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // The desired state of ClusterResourcePlacement. // +required Spec ClusterResourcePlacementSpec `json:"spec"` // The observed status of ClusterResourcePlacement. // +optional Status ClusterResourcePlacementStatus `json:"status,omitempty"` }
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`.
func (*ClusterResourcePlacement) DeepCopy ¶
func (in *ClusterResourcePlacement) DeepCopy() *ClusterResourcePlacement
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacement.
func (*ClusterResourcePlacement) DeepCopyInto ¶
func (in *ClusterResourcePlacement) DeepCopyInto(out *ClusterResourcePlacement)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterResourcePlacement) DeepCopyObject ¶
func (in *ClusterResourcePlacement) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ClusterResourcePlacement) GetCondition ¶
func (m *ClusterResourcePlacement) GetCondition(conditionType string) *metav1.Condition
GetCondition returns the condition of the ClusterResourcePlacement objects.
func (*ClusterResourcePlacement) SetConditions ¶
func (m *ClusterResourcePlacement) SetConditions(conditions ...metav1.Condition)
SetConditions sets the conditions of the ClusterResourcePlacement.
func (*ClusterResourcePlacement) Tolerations ¶ added in v0.9.2
func (m *ClusterResourcePlacement) Tolerations() []Toleration
Tolerations returns tolerations for ClusterResourcePlacement.
type ClusterResourcePlacementConditionType ¶
type ClusterResourcePlacementConditionType string
ClusterResourcePlacementConditionType defines a specific condition of a cluster resource placement. +enum
const ( // ClusterResourcePlacementScheduledConditionType indicates whether we have successfully scheduled the // ClusterResourcePlacement. // Its condition status can be one of the following: // - "True" means we have successfully scheduled the resources to fully satisfy the placement requirement. // - "False" means we didn't fully satisfy the placement requirement. We will fill the Reason field. // - "Unknown" means we don't have a scheduling decision yet. ClusterResourcePlacementScheduledConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementScheduled" // ClusterResourcePlacementSynchronizedConditionType indicates whether the selected resources are synchronized under // the per-cluster namespaces (i.e., fleet-member-<member-name>) on the hub cluster. // Its condition status can be one of the following: // - "True" means all the selected resources are successfully synchronized under the per-cluster namespaces // (i.e., fleet-member-<member-name>) on the hub cluster. // - "False" means all the selected resources have not been synchronized under the per-cluster namespaces // (i.e., fleet-member-<member-name>) on the hub cluster yet. // To be deprecated, it will be replaced by ClusterResourcePlacementRolloutStarted and ClusterResourcePlacementWorkSynchronized // conditions. ClusterResourcePlacementSynchronizedConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementSynchronized" // ClusterResourcePlacementRolloutStartedConditionType indicates whether the selected resources start rolling out or // not. // Its condition status can be one of the following: // - "True" means the selected resources successfully start rolling out in all scheduled clusters. // - "False" means the selected resources have not been rolled out in all scheduled clusters yet. // - "Unknown" means we don't have a rollout decision yet. ClusterResourcePlacementRolloutStartedConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementRolloutStarted" // ClusterResourcePlacementOverriddenConditionType indicates whether all the selected resources have been overridden // successfully before applying to the target cluster. // Its condition status can be one of the following: // - "True" means all the selected resources are successfully overridden before applying to the target cluster or // override is not needed if there is no override defined with the reason of NoOverrideSpecified. // - "False" means some of them have failed. // - "Unknown" means we haven't finished the override yet. ClusterResourcePlacementOverriddenConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementOverridden" // ClusterResourcePlacementWorkSynchronizedConditionType indicates whether the selected resources are created or updated // under the per-cluster namespaces (i.e., fleet-member-<member-name>) on the hub cluster. // Its condition status can be one of the following: // - "True" means all the selected resources are successfully created or updated under the per-cluster namespaces // (i.e., fleet-member-<member-name>) on the hub cluster. // - "False" means all the selected resources have not been created or updated under the per-cluster namespaces // (i.e., fleet-member-<member-name>) on the hub cluster yet. // - "Unknown" means we haven't started processing the work yet. ClusterResourcePlacementWorkSynchronizedConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementWorkSynchronized" // ClusterResourcePlacementAppliedConditionType indicates whether all the selected member clusters have applied // the selected resources locally. // Its condition status can be one of the following: // - "True" means all the selected resources are successfully applied to all the target clusters or apply is not needed // if there are no cluster(s) selected by the scheduler. // - "False" means some of them have failed. We will place some of the detailed failure in the FailedResourcePlacement array. // - "Unknown" means we haven't finished the apply yet. ClusterResourcePlacementAppliedConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementApplied" // ClusterResourcePlacementAvailableConditionType indicates whether the selected resources are available on all the // selected member clusters. // Its condition status can be one of the following: // - "True" means all the selected resources are available on all the selected member clusters. // - "False" means some of them are not available yet. We will place some of the detailed failure in the FailedResourcePlacement // array. // - "Unknown" means we haven't finished the apply yet so that we cannot check the resource availability. ClusterResourcePlacementAvailableConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementAvailable" )
type ClusterResourcePlacementList ¶
type ClusterResourcePlacementList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []ClusterResourcePlacement `json:"items"` }
ClusterResourcePlacementList contains a list of ClusterResourcePlacement. +kubebuilder:resource:scope="Cluster" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*ClusterResourcePlacementList) DeepCopy ¶
func (in *ClusterResourcePlacementList) DeepCopy() *ClusterResourcePlacementList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementList.
func (*ClusterResourcePlacementList) DeepCopyInto ¶
func (in *ClusterResourcePlacementList) DeepCopyInto(out *ClusterResourcePlacementList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterResourcePlacementList) DeepCopyObject ¶
func (in *ClusterResourcePlacementList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterResourcePlacementSpec ¶
type ClusterResourcePlacementSpec struct { // ResourceSelectors is an array of selectors used to select cluster scoped resources. The selectors are `ORed`. // You can have 1-100 selectors. // +required ResourceSelectors []ClusterResourceSelector `json:"resourceSelectors"` // Policy defines how to select member clusters to place the selected resources. // If unspecified, all the joined member clusters are selected. // +optional Policy *PlacementPolicy `json:"policy,omitempty"` // The rollout strategy to use to replace existing placement with new ones. // +optional // +patchStrategy=retainKeys Strategy RolloutStrategy `json:"strategy,omitempty"` // The 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. // +kubebuilder:validation:Minimum=1 // +kubebuilder:validation:Maximum=1000 // +kubebuilder:default=10 // +optional RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` }
ClusterResourcePlacementSpec defines the desired state of ClusterResourcePlacement.
func (*ClusterResourcePlacementSpec) DeepCopy ¶
func (in *ClusterResourcePlacementSpec) DeepCopy() *ClusterResourcePlacementSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementSpec.
func (*ClusterResourcePlacementSpec) DeepCopyInto ¶
func (in *ClusterResourcePlacementSpec) DeepCopyInto(out *ClusterResourcePlacementSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterResourcePlacementStatus ¶
type ClusterResourcePlacementStatus struct { // SelectedResources contains a list of resources selected by ResourceSelectors. // +optional SelectedResources []ResourceIdentifier `json:"selectedResources,omitempty"` // Resource 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 `ClusterResourcePlacementSynchronized` type // is observing the synchronization status of the resource snapshot with the resource index $ObservedResourceIndex. // +optional ObservedResourceIndex string `json:"observedResourceIndex,omitempty"` // PlacementStatuses 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. // +optional PlacementStatuses []ResourcePlacementStatus `json:"placementStatuses,omitempty"` // Conditions is an array of current observed conditions for ClusterResourcePlacement. // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` }
ClusterResourcePlacementStatus defines the observed state of the ClusterResourcePlacement object.
func (*ClusterResourcePlacementStatus) DeepCopy ¶
func (in *ClusterResourcePlacementStatus) DeepCopy() *ClusterResourcePlacementStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementStatus.
func (*ClusterResourcePlacementStatus) DeepCopyInto ¶
func (in *ClusterResourcePlacementStatus) DeepCopyInto(out *ClusterResourcePlacementStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterResourceSelector ¶
type ClusterResourceSelector struct { // Group name of the cluster-scoped resource. // Use an empty string to select resources under the core API group (e.g., namespaces). // +required Group string `json:"group"` // Version of the cluster-scoped resource. // +required Version string `json:"version"` // Kind of the cluster-scoped resource. // Note: When `Kind` is `namespace`, ALL the resources under the selected namespaces are selected. // +required Kind string `json:"kind"` // Name of the cluster-scoped resource. // +optional Name string `json:"name,omitempty"` // A 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. // +optional LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"` }
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.
func (*ClusterResourceSelector) DeepCopy ¶
func (in *ClusterResourceSelector) DeepCopy() *ClusterResourceSelector
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSelector.
func (*ClusterResourceSelector) DeepCopyInto ¶
func (in *ClusterResourceSelector) DeepCopyInto(out *ClusterResourceSelector)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterResourceSnapshot ¶
type ClusterResourceSnapshot struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // The desired state of ResourceSnapshot. // +required Spec ResourceSnapshotSpec `json:"spec"` // The observed status of ResourceSnapshot. // +optional Status ResourceSnapshotStatus `json:"status,omitempty"` }
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.
func (*ClusterResourceSnapshot) DeepCopy ¶
func (in *ClusterResourceSnapshot) DeepCopy() *ClusterResourceSnapshot
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSnapshot.
func (*ClusterResourceSnapshot) DeepCopyInto ¶
func (in *ClusterResourceSnapshot) DeepCopyInto(out *ClusterResourceSnapshot)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterResourceSnapshot) DeepCopyObject ¶
func (in *ClusterResourceSnapshot) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ClusterResourceSnapshot) GetCondition ¶
func (m *ClusterResourceSnapshot) GetCondition(conditionType string) *metav1.Condition
GetCondition gets the condition for a ClusterResourceSnapshot.
func (*ClusterResourceSnapshot) SetConditions ¶
func (m *ClusterResourceSnapshot) SetConditions(conditions ...metav1.Condition)
SetConditions sets the conditions for a ClusterResourceSnapshot.
type ClusterResourceSnapshotList ¶
type ClusterResourceSnapshotList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []ClusterResourceSnapshot `json:"items"` }
ClusterResourceSnapshotList contains a list of ClusterResourceSnapshot. +kubebuilder:resource:scope="Cluster" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*ClusterResourceSnapshotList) DeepCopy ¶
func (in *ClusterResourceSnapshotList) DeepCopy() *ClusterResourceSnapshotList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSnapshotList.
func (*ClusterResourceSnapshotList) DeepCopyInto ¶
func (in *ClusterResourceSnapshotList) DeepCopyInto(out *ClusterResourceSnapshotList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterResourceSnapshotList) DeepCopyObject ¶
func (in *ClusterResourceSnapshotList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterSchedulingPolicySnapshot ¶
type ClusterSchedulingPolicySnapshot struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // The desired state of SchedulingPolicySnapshot. // +required Spec SchedulingPolicySnapshotSpec `json:"spec"` // The observed status of SchedulingPolicySnapshot. // +optional Status SchedulingPolicySnapshotStatus `json:"status,omitempty"` }
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.
func (*ClusterSchedulingPolicySnapshot) DeepCopy ¶
func (in *ClusterSchedulingPolicySnapshot) DeepCopy() *ClusterSchedulingPolicySnapshot
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSchedulingPolicySnapshot.
func (*ClusterSchedulingPolicySnapshot) DeepCopyInto ¶
func (in *ClusterSchedulingPolicySnapshot) DeepCopyInto(out *ClusterSchedulingPolicySnapshot)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterSchedulingPolicySnapshot) DeepCopyObject ¶
func (in *ClusterSchedulingPolicySnapshot) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ClusterSchedulingPolicySnapshot) GetCondition ¶
func (m *ClusterSchedulingPolicySnapshot) GetCondition(conditionType string) *metav1.Condition
GetCondition returns the condition of the given type if exists.
func (*ClusterSchedulingPolicySnapshot) SetConditions ¶
func (m *ClusterSchedulingPolicySnapshot) SetConditions(conditions ...metav1.Condition)
SetConditions sets the given conditions on the ClusterSchedulingPolicySnapshot.
func (*ClusterSchedulingPolicySnapshot) Tolerations ¶ added in v0.9.2
func (m *ClusterSchedulingPolicySnapshot) Tolerations() []Toleration
Tolerations returns tolerations for ClusterSchedulingPolicySnapshot.
type ClusterSchedulingPolicySnapshotList ¶
type ClusterSchedulingPolicySnapshotList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []ClusterSchedulingPolicySnapshot `json:"items"` }
ClusterSchedulingPolicySnapshotList contains a list of ClusterSchedulingPolicySnapshot. +kubebuilder:resource:scope="Cluster" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*ClusterSchedulingPolicySnapshotList) DeepCopy ¶
func (in *ClusterSchedulingPolicySnapshotList) DeepCopy() *ClusterSchedulingPolicySnapshotList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSchedulingPolicySnapshotList.
func (*ClusterSchedulingPolicySnapshotList) DeepCopyInto ¶
func (in *ClusterSchedulingPolicySnapshotList) DeepCopyInto(out *ClusterSchedulingPolicySnapshotList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterSchedulingPolicySnapshotList) DeepCopyObject ¶
func (in *ClusterSchedulingPolicySnapshotList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterScore ¶
type ClusterScore struct { // 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. // +optional AffinityScore *int32 `json:"affinityScore,omitempty"` // 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. // +optional TopologySpreadScore *int32 `json:"priorityScore,omitempty"` }
ClusterScore represents the score of the cluster calculated by the scheduler.
func (*ClusterScore) DeepCopy ¶
func (in *ClusterScore) DeepCopy() *ClusterScore
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScore.
func (*ClusterScore) DeepCopyInto ¶
func (in *ClusterScore) DeepCopyInto(out *ClusterScore)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterSelector ¶
type ClusterSelector struct { // +kubebuilder:validation:MaxItems=10 // ClusterSelectorTerms is a list of cluster selector terms. The terms are `ORed`. // +required ClusterSelectorTerms []ClusterSelectorTerm `json:"clusterSelectorTerms"` }
func (*ClusterSelector) DeepCopy ¶
func (in *ClusterSelector) DeepCopy() *ClusterSelector
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSelector.
func (*ClusterSelector) DeepCopyInto ¶
func (in *ClusterSelector) DeepCopyInto(out *ClusterSelector)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterSelectorTerm ¶
type ClusterSelectorTerm struct { // LabelSelector is a label query over all the joined member clusters. Clusters matching // the query are selected. // // If you specify both label and property selectors in the same term, the results are AND'd. // +optional LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"` // PropertySelector is a property query over all joined member clusters. Clusters matching // the query are selected. // // If you specify both label and property selectors in the same term, the results are AND'd. // // At this moment, PropertySelector can only be used with // `RequiredDuringSchedulingIgnoredDuringExecution` affinity terms. // // This field is beta-level; it is for the property-based scheduling feature and is only // functional when a property provider is enabled in the deployment. // +optional PropertySelector *PropertySelector `json:"propertySelector,omitempty"` // PropertySorter sorts all matching clusters by a specific property and assigns different weights // to each cluster based on their observed property values. // // At this moment, PropertySorter can only be used with // `PreferredDuringSchedulingIgnoredDuringExecution` affinity terms. // // This field is beta-level; it is for the property-based scheduling feature and is only // functional when a property provider is enabled in the deployment. // +optional PropertySorter *PropertySorter `json:"propertySorter,omitempty"` }
func (*ClusterSelectorTerm) DeepCopy ¶
func (in *ClusterSelectorTerm) DeepCopy() *ClusterSelectorTerm
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSelectorTerm.
func (*ClusterSelectorTerm) DeepCopyInto ¶
func (in *ClusterSelectorTerm) DeepCopyInto(out *ClusterSelectorTerm)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EnvelopeIdentifier ¶ added in v0.7.5
type EnvelopeIdentifier struct { // Name of the envelope object. // +required Name string `json:"name"` // Namespace is the namespace of the envelope object. Empty if the envelope object is cluster scoped. // +optional Namespace string `json:"namespace,omitempty"` // Type of the envelope object. // +kubebuilder:validation:Enum=ConfigMap // +kubebuilder:default=ConfigMap // +optional Type EnvelopeType `json:"type"` }
EnvelopeIdentifier identifies the envelope object that contains the selected resource.
func (*EnvelopeIdentifier) DeepCopy ¶ added in v0.7.5
func (in *EnvelopeIdentifier) DeepCopy() *EnvelopeIdentifier
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvelopeIdentifier.
func (*EnvelopeIdentifier) DeepCopyInto ¶ added in v0.7.5
func (in *EnvelopeIdentifier) DeepCopyInto(out *EnvelopeIdentifier)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EnvelopeType ¶ added in v0.7.5
type EnvelopeType string
EnvelopeType defines the type of the envelope object. +enum
const ( // ConfigMapEnvelopeType means the envelope object is of type `ConfigMap`. ConfigMapEnvelopeType EnvelopeType = "ConfigMap" )
type FailedResourcePlacement ¶
type FailedResourcePlacement struct { // The resource failed to be placed. // +required ResourceIdentifier `json:",inline"` // The failed condition status. // +required Condition metav1.Condition `json:"condition"` }
FailedResourcePlacement contains the failure details of a failed resource placement.
func (*FailedResourcePlacement) DeepCopy ¶
func (in *FailedResourcePlacement) DeepCopy() *FailedResourcePlacement
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailedResourcePlacement.
func (*FailedResourcePlacement) DeepCopyInto ¶
func (in *FailedResourcePlacement) DeepCopyInto(out *FailedResourcePlacement)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Manifest ¶ added in v0.6.9
type Manifest struct { // +kubebuilder:validation:EmbeddedResource // +kubebuilder:pruning:PreserveUnknownFields runtime.RawExtension `json:",inline"` }
Manifest represents a resource to be deployed on spoke cluster.
func (*Manifest) DeepCopy ¶ added in v0.6.9
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Manifest.
func (*Manifest) DeepCopyInto ¶ added in v0.6.9
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ManifestCondition ¶ added in v0.6.9
type ManifestCondition struct { // resourceId represents a identity of a resource linking to manifests in spec. // +required Identifier WorkResourceIdentifier `json:"identifier,omitempty"` // Conditions represents the conditions of this resource on spoke cluster // +required Conditions []metav1.Condition `json:"conditions"` }
ManifestCondition represents the conditions of the resources deployed on spoke cluster.
func (*ManifestCondition) DeepCopy ¶ added in v0.6.9
func (in *ManifestCondition) DeepCopy() *ManifestCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestCondition.
func (*ManifestCondition) DeepCopyInto ¶ added in v0.6.9
func (in *ManifestCondition) DeepCopyInto(out *ManifestCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NamespacedName ¶ added in v0.8.7
type NamespacedName struct { // Name is the name of the namespaced scope resource. // +required Name string `json:"name"` // Namespace is namespace of the namespaced scope resource. // +required Namespace string `json:"namespace"` }
NamespacedName comprises a resource name, with a mandatory namespace.
func (*NamespacedName) DeepCopy ¶ added in v0.8.7
func (in *NamespacedName) DeepCopy() *NamespacedName
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedName.
func (*NamespacedName) DeepCopyInto ¶ added in v0.8.7
func (in *NamespacedName) DeepCopyInto(out *NamespacedName)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PlacementPolicy ¶
type PlacementPolicy struct { // Type of placement. Can be "PickAll", "PickN" or "PickFixed". Default is PickAll. // +kubebuilder:validation:Enum=PickAll;PickN;PickFixed // +kubebuilder:default=PickAll // +optional PlacementType PlacementType `json:"placementType,omitempty"` // +kubebuilder:validation:MaxItems=100 // ClusterNames contains a list of names of MemberCluster to place the selected resources. // Only valid if the placement type is "PickFixed" // +optional ClusterNames []string `json:"clusterNames,omitempty"` // NumberOfClusters of placement. Only valid if the placement type is "PickN". // +kubebuilder:validation:Minimum=0 // +optional NumberOfClusters *int32 `json:"numberOfClusters,omitempty"` // Affinity contains cluster affinity scheduling rules. Defines which member clusters to place the selected resources. // Only valid if the placement type is "PickAll" or "PickN". // +optional Affinity *Affinity `json:"affinity,omitempty"` // TopologySpreadConstraints 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". // +optional // +patchMergeKey=topologyKey // +patchStrategy=merge TopologySpreadConstraints []TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty" patchStrategy:"merge" patchMergeKey:"topologyKey"` // If specified, the ClusterResourcePlacement's Tolerations. // Tolerations cannot be updated or deleted. // // This field is beta-level and is for the taints and tolerations feature. // +kubebuilder:validation:MaxItems=100 // +optional Tolerations []Toleration `json:"tolerations,omitempty"` }
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.
func (*PlacementPolicy) DeepCopy ¶
func (in *PlacementPolicy) DeepCopy() *PlacementPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementPolicy.
func (*PlacementPolicy) DeepCopyInto ¶
func (in *PlacementPolicy) DeepCopyInto(out *PlacementPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PlacementType ¶
type PlacementType string
PlacementType identifies the type of placement. +enum
const ( // PickAllPlacementType picks all clusters that satisfy the rules. PickAllPlacementType PlacementType = "PickAll" // PickNPlacementType picks N clusters that satisfy the rules. PickNPlacementType PlacementType = "PickN" // PickFixedPlacementType picks a fixed set of clusters. PickFixedPlacementType PlacementType = "PickFixed" )
type PreferredClusterSelector ¶
type PreferredClusterSelector struct { // Weight associated with matching the corresponding clusterSelectorTerm, in the range [-100, 100]. // +required // +kubebuilder:validation:Minimum=-100 // +kubebuilder:validation:Maximum=100 Weight int32 `json:"weight"` // A cluster selector term, associated with the corresponding weight. // +required Preference ClusterSelectorTerm `json:"preference"` }
func (*PreferredClusterSelector) DeepCopy ¶
func (in *PreferredClusterSelector) DeepCopy() *PreferredClusterSelector
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreferredClusterSelector.
func (*PreferredClusterSelector) DeepCopyInto ¶
func (in *PreferredClusterSelector) DeepCopyInto(out *PreferredClusterSelector)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PropertySelector ¶ added in v0.9.2
type PropertySelector struct { // MatchExpressions is an array of PropertySelectorRequirements. The requirements are AND'd. // +required MatchExpressions []PropertySelectorRequirement `json:"matchExpressions"` }
PropertySelector helps user specify property requirements when picking clusters for resource placement.
func (*PropertySelector) DeepCopy ¶ added in v0.9.2
func (in *PropertySelector) DeepCopy() *PropertySelector
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropertySelector.
func (*PropertySelector) DeepCopyInto ¶ added in v0.9.2
func (in *PropertySelector) DeepCopyInto(out *PropertySelector)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PropertySelectorOperator ¶ added in v0.9.2
type PropertySelectorOperator string
PropertySelectorOperator is the operator that can be used with PropertySelectorRequirements. +enum
const ( // PropertySelectorGreaterThan dictates Fleet to select cluster if its observed value of a given // property is greater than the value specified in the requirement. PropertySelectorGreaterThan PropertySelectorOperator = "Gt" // PropertySelectorGreaterThanOrEqualTo 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. PropertySelectorGreaterThanOrEqualTo PropertySelectorOperator = "Ge" // PropertySelectorEqualTo dictates Fleet to select cluster if its observed value of a given // property is equal to the values specified in the requirement. PropertySelectorEqualTo PropertySelectorOperator = "Eq" // PropertySelectorNotEqualTo dictates Fleet to select cluster if its observed value of a given // property is not equal to the values specified in the requirement. PropertySelectorNotEqualTo PropertySelectorOperator = "Ne" // PropertySelectorLessThan dictates Fleet to select cluster if its observed value of a given // property is less than the value specified in the requirement. PropertySelectorLessThan PropertySelectorOperator = "Lt" // PropertySelectorLessThanOrEqualTo 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. PropertySelectorLessThanOrEqualTo PropertySelectorOperator = "Le" )
type PropertySelectorRequirement ¶ added in v0.9.2
type PropertySelectorRequirement struct { // Name is the name of the property; it should be a Kubernetes label name. // +required Name string `json:"name"` // Operator specifies the relationship between a cluster's observed value of the specified // property and the values given in the requirement. // +required Operator PropertySelectorOperator `json:"operator"` // Values 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. // // +kubebuilder:validation:MaxItems=1 // +required Values []string `json:"values"` }
PropertySelectorRequirement is a specific property requirement when picking clusters for resource placement.
func (*PropertySelectorRequirement) DeepCopy ¶ added in v0.9.2
func (in *PropertySelectorRequirement) DeepCopy() *PropertySelectorRequirement
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropertySelectorRequirement.
func (*PropertySelectorRequirement) DeepCopyInto ¶ added in v0.9.2
func (in *PropertySelectorRequirement) DeepCopyInto(out *PropertySelectorRequirement)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PropertySortOrder ¶ added in v0.9.2
type PropertySortOrder string
+enum
const ( // Descending 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 Descending PropertySortOrder = "Descending" // Ascending 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 Ascending PropertySortOrder = "Ascending" )
type PropertySorter ¶ added in v0.9.2
type PropertySorter struct { // Name is the name of the property which Fleet sorts clusters by. // +required Name string `json:"name"` // SortOrder explains how Fleet should perform the sort; specifically, whether Fleet should // sort in ascending or descending order. // +required SortOrder PropertySortOrder `json:"sortOrder"` }
PropertySorter helps user specify how to sort clusters based on a specific property.
func (*PropertySorter) DeepCopy ¶ added in v0.9.2
func (in *PropertySorter) DeepCopy() *PropertySorter
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropertySorter.
func (*PropertySorter) DeepCopyInto ¶ added in v0.9.2
func (in *PropertySorter) DeepCopyInto(out *PropertySorter)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceBindingConditionType ¶
type ResourceBindingConditionType string
ResourceBindingConditionType identifies a specific condition of the ClusterResourceBinding.
const ( // ResourceBindingRolloutStarted indicates whether the binding can roll out the latest changes of the given resources. // Its condition status can be one of the following: // - "True" means the spec of the binding is updated to the latest resource snapshots and their overrides and rollout // has been started. // - "False" means the spec of the binding cannot be updated to the latest resource snapshots and their overrides because // of the rollout strategy. // - "Unknown" means it is unknown. ResourceBindingRolloutStarted ResourceBindingConditionType = "RolloutStarted" // ResourceBindingOverridden indicates the overridden condition of the given resources. // Its condition status can be one of the following: // - "True" means the resources are overridden successfully or there are no overrides associated before applying // to the target cluster. // - "False" means the resources fail to be overridden before applying to the target cluster. // - "Unknown" means it is unknown. ResourceBindingOverridden ResourceBindingConditionType = "Overridden" // ResourceBindingWorkSynchronized indicates the work synchronized condition of the given resources. // Its condition status can be one of the following: // - "True" means all corresponding works are created or updated in the target cluster's namespace. // - "False" means not all corresponding works are created or updated in the target cluster's namespace yet. // - "Unknown" means it is unknown. ResourceBindingWorkSynchronized ResourceBindingConditionType = "WorkSynchronized" // ResourceBindingApplied indicates the applied condition of the given resources. // Its condition status can be one of the following: // - "True" means all the resources are created in the target cluster. // - "False" means not all the resources are created in the target cluster yet. // - "Unknown" means it is unknown. ResourceBindingApplied ResourceBindingConditionType = "Applied" // ResourceBindingAvailable indicates the available condition of the given resources. // Its condition status can be one of the following: // - "True" means all the resources are available in the target cluster. // - "False" means not all the resources are available in the target cluster yet. // - "Unknown" means we haven't finished the apply yet so that we cannot check the resource availability. ResourceBindingAvailable ResourceBindingConditionType = "Available" )
type ResourceBindingSpec ¶
type ResourceBindingSpec struct { // The desired state of the binding. Possible values: Scheduled, Bound, Unscheduled. // +required State BindingState `json:"state"` // ResourceSnapshotName 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. ResourceSnapshotName string `json:"resourceSnapshotName"` // ResourceOverrideSnapshots is a list of ResourceOverride snapshots associated with the selected resources. ResourceOverrideSnapshots []NamespacedName `json:"resourceOverrideSnapshots,omitempty"` // ClusterResourceOverrides contains a list of applicable ClusterResourceOverride snapshot names associated with the // selected resources. ClusterResourceOverrideSnapshots []string `json:"clusterResourceOverrideSnapshots,omitempty"` // SchedulingPolicySnapshotName 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. SchedulingPolicySnapshotName string `json:"schedulingPolicySnapshotName"` // TargetCluster is the name of the cluster that the scheduler assigns the resources to. TargetCluster string `json:"targetCluster"` // ClusterDecision explains why the scheduler selected this cluster. ClusterDecision ClusterDecision `json:"clusterDecision"` // ApplyStrategy describes how to resolve the conflict if the resource to be placed already exists in the target cluster // and is owned by other appliers. // +optional ApplyStrategy *ApplyStrategy `json:"applyStrategy,omitempty"` }
ResourceBindingSpec defines the desired state of ClusterResourceBinding.
func (*ResourceBindingSpec) DeepCopy ¶
func (in *ResourceBindingSpec) DeepCopy() *ResourceBindingSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceBindingSpec.
func (*ResourceBindingSpec) DeepCopyInto ¶
func (in *ResourceBindingSpec) DeepCopyInto(out *ResourceBindingSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceBindingStatus ¶
type ResourceBindingStatus struct { // FailedPlacements 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. // +optional FailedPlacements []FailedResourcePlacement `json:"failedPlacements,omitempty"` // Conditions is an array of current observed conditions for ClusterResourceBinding. // +optional Conditions []metav1.Condition `json:"conditions"` }
ResourceBindingStatus represents the current status of a ClusterResourceBinding.
func (*ResourceBindingStatus) DeepCopy ¶
func (in *ResourceBindingStatus) DeepCopy() *ResourceBindingStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceBindingStatus.
func (*ResourceBindingStatus) DeepCopyInto ¶
func (in *ResourceBindingStatus) DeepCopyInto(out *ResourceBindingStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceContent ¶
type ResourceContent struct { // +kubebuilder:validation:EmbeddedResource // +kubebuilder:pruning:PreserveUnknownFields runtime.RawExtension `json:"-,inline"` }
ResourceContent contains the content of a resource
func (*ResourceContent) DeepCopy ¶
func (in *ResourceContent) DeepCopy() *ResourceContent
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceContent.
func (*ResourceContent) DeepCopyInto ¶
func (in *ResourceContent) DeepCopyInto(out *ResourceContent)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceIdentifier ¶
type ResourceIdentifier struct { // Group is the group name of the selected resource. // +optional Group string `json:"group,omitempty"` // Version is the version of the selected resource. // +required Version string `json:"version"` // Kind represents the Kind of the selected resources. // +required Kind string `json:"kind"` // Name of the target resource. // +required Name string `json:"name"` // Namespace is the namespace of the resource. Empty if the resource is cluster scoped. // +optional Namespace string `json:"namespace,omitempty"` // Envelope identifies the envelope object that contains this resource. // +optional Envelope *EnvelopeIdentifier `json:"envelope,omitempty"` }
ResourceIdentifier identifies one Kubernetes resource.
func (*ResourceIdentifier) DeepCopy ¶
func (in *ResourceIdentifier) DeepCopy() *ResourceIdentifier
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceIdentifier.
func (*ResourceIdentifier) DeepCopyInto ¶
func (in *ResourceIdentifier) DeepCopyInto(out *ResourceIdentifier)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePlacementConditionType ¶
type ResourcePlacementConditionType string
ResourcePlacementConditionType defines a specific condition of a resource placement. +enum
const ( // ResourceScheduledConditionType indicates whether we have successfully scheduled the selected resources. // Its condition status can be one of the following: // - "True" means we have successfully scheduled the resources to satisfy the placement requirement. // - "False" means we didn't fully satisfy the placement requirement. We will fill the Message field. ResourceScheduledConditionType ResourcePlacementConditionType = "Scheduled" // ResourceRolloutStartedConditionType indicates whether the selected resources start rolling out or // not. // Its condition status can be one of the following: // - "True" means the selected resources successfully start rolling out in the target clusters. // - "False" means the selected resources have not been rolled out in the target cluster yet to honor the rollout // strategy configurations specified in the placement // - "Unknown" means it is in the processing state. ResourceRolloutStartedConditionType ResourcePlacementConditionType = "RolloutStarted" // ResourceOverriddenConditionType indicates whether all the selected resources have been overridden successfully // before applying to the target cluster if there is any override defined. // Its condition status can be one of the following: // - "True" means all the selected resources are successfully overridden before applying to the target cluster or // override is not needed if there is no override defined with the reason of NoOverrideSpecified. // - "False" means some of them have failed. // - "Unknown" means we haven't finished the override yet. ResourceOverriddenConditionType ResourcePlacementConditionType = "Overridden" // ResourceWorkSynchronizedConditionType indicates whether we have created or updated the corresponding work object(s) // under the per-cluster namespaces (i.e., fleet-member-<member-name>) which have the latest resources selected by // the placement. // Its condition status can be one of the following: // - "True" means we have successfully created the latest corresponding work(s) or updated the existing work(s) to // the latest. // - "False" means we have not created the latest corresponding work(s) or updated the existing work(s) to the latest // yet. // - "Unknown" means we haven't finished creating work yet. ResourceWorkSynchronizedConditionType ResourcePlacementConditionType = "WorkSynchronized" // ResourcesAppliedConditionType indicates whether the selected member cluster has applied the selected resources locally. // Its condition status can be one of the following: // - "True" means all the selected resources are successfully applied to the target cluster. // - "False" means some of them have failed. // - "Unknown" means we haven't finished the apply yet. ResourcesAppliedConditionType ResourcePlacementConditionType = "Applied" // ResourcesAvailableConditionType indicates whether the selected resources are available on the selected member cluster. // Its condition status can be one of the following: // - "True" means all the selected resources are available on the target cluster. // - "False" means some of them are not available yet. // - "Unknown" means we haven't finished the apply yet so that we cannot check the resource availability. ResourcesAvailableConditionType ResourcePlacementConditionType = "Available" )
type ResourcePlacementStatus ¶
type ResourcePlacementStatus struct { // ClusterName 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. // +optional ClusterName string `json:"clusterName,omitempty"` // ApplicableResourceOverrides contains a list of applicable ResourceOverride snapshots associated with the selected // resources. // // This field is alpha-level and is for the override policy feature. // +optional ApplicableResourceOverrides []NamespacedName `json:"applicableResourceOverrides,omitempty"` // ApplicableClusterResourceOverrides contains a list of applicable ClusterResourceOverride snapshots associated with // the selected resources. // // This field is alpha-level and is for the override policy feature. // +optional ApplicableClusterResourceOverrides []string `json:"applicableClusterResourceOverrides,omitempty"` // FailedPlacements 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. // +optional FailedPlacements []FailedResourcePlacement `json:"failedPlacements,omitempty"` // Conditions is an array of current observed conditions for ResourcePlacementStatus. // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` }
ResourcePlacementStatus represents the placement status of selected resources for one target cluster.
func (*ResourcePlacementStatus) DeepCopy ¶
func (in *ResourcePlacementStatus) DeepCopy() *ResourcePlacementStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePlacementStatus.
func (*ResourcePlacementStatus) DeepCopyInto ¶
func (in *ResourcePlacementStatus) DeepCopyInto(out *ResourcePlacementStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceSnapshotSpec ¶
type ResourceSnapshotSpec struct { // SelectedResources contains a list of resources selected by ResourceSelectors. // +required SelectedResources []ResourceContent `json:"selectedResources"` }
ResourceSnapshotSpec defines the desired state of ResourceSnapshot.
func (*ResourceSnapshotSpec) DeepCopy ¶
func (in *ResourceSnapshotSpec) DeepCopy() *ResourceSnapshotSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSnapshotSpec.
func (*ResourceSnapshotSpec) DeepCopyInto ¶
func (in *ResourceSnapshotSpec) DeepCopyInto(out *ResourceSnapshotSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceSnapshotStatus ¶
type ResourceSnapshotStatus struct { // Conditions is an array of current observed conditions for ResourceSnapshot. // +optional Conditions []metav1.Condition `json:"conditions"` }
func (*ResourceSnapshotStatus) DeepCopy ¶
func (in *ResourceSnapshotStatus) DeepCopy() *ResourceSnapshotStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSnapshotStatus.
func (*ResourceSnapshotStatus) DeepCopyInto ¶
func (in *ResourceSnapshotStatus) DeepCopyInto(out *ResourceSnapshotStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RollingUpdateConfig ¶
type RollingUpdateConfig struct { // 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. // This can not be 0 if MaxSurge is 0. // Defaults to 25%. // +kubebuilder:default="25%" // +kubebuilder:validation:XIntOrString // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" // +optional MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` // The 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 upgrade of resources on the same cluster. // This can not be 0 if MaxUnavailable is 0. // Defaults to 25%. // +kubebuilder:default="25%" // +kubebuilder:validation:XIntOrString // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" // +optional MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` // A resource placement is considered available after `UnavailablePeriodSeconds` seconds // has passed after the resources are applied to the target cluster successfully. // Default is 60. // +kubebuilder:default=60 // +optional UnavailablePeriodSeconds *int `json:"unavailablePeriodSeconds,omitempty"` }
RollingUpdateConfig contains the config to control the desired behavior of rolling update.
func (*RollingUpdateConfig) DeepCopy ¶
func (in *RollingUpdateConfig) DeepCopy() *RollingUpdateConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollingUpdateConfig.
func (*RollingUpdateConfig) DeepCopyInto ¶
func (in *RollingUpdateConfig) DeepCopyInto(out *RollingUpdateConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RolloutStrategy ¶
type RolloutStrategy struct { // Type of rollout. The only supported type is "RollingUpdate". Default is "RollingUpdate". // +optional // +kubebuilder:validation:Enum=RollingUpdate // +kubebuilder:default=RollingUpdate Type RolloutStrategyType `json:"type,omitempty"` // Rolling update config params. Present only if RolloutStrategyType = RollingUpdate. // +optional RollingUpdate *RollingUpdateConfig `json:"rollingUpdate,omitempty"` // ApplyStrategy describes how to resolve the conflict if the resource to be placed already exists in the target cluster // and is owned by other appliers. // +optional ApplyStrategy *ApplyStrategy `json:"applyStrategy,omitempty"` }
RolloutStrategy describes how to roll out a new change in selected resources to target clusters.
func (*RolloutStrategy) DeepCopy ¶
func (in *RolloutStrategy) DeepCopy() *RolloutStrategy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutStrategy.
func (*RolloutStrategy) DeepCopyInto ¶
func (in *RolloutStrategy) DeepCopyInto(out *RolloutStrategy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RolloutStrategyType ¶
type RolloutStrategyType string
+enum
const ( // RollingUpdateRolloutStrategyType replaces the old placed resource using rolling update // i.e. gradually create the new one while replace the old ones. RollingUpdateRolloutStrategyType RolloutStrategyType = "RollingUpdate" )
type SchedulingPolicySnapshotConditionType ¶
type SchedulingPolicySnapshotConditionType string
SchedulingPolicySnapshotConditionType identifies a specific condition of the SchedulingPolicySnapshot.
const ( // Scheduled indicates the scheduled condition of the given SchedulingPolicySnapshot. // Its condition status can be one of the following: // - "True" means we have successfully scheduled corresponding SchedulingPolicySnapshot to fully satisfy the // placement requirement. // - "False" means we did not fully satisfy the placement requirement of the corresponding SchedulingPolicySnapshot. // - "Unknown" means the status of the scheduling is unknown. PolicySnapshotScheduled SchedulingPolicySnapshotConditionType = "Scheduled" )
type SchedulingPolicySnapshotSpec ¶
type SchedulingPolicySnapshotSpec struct { // Policy defines how to select member clusters to place the selected resources. // If unspecified, all the joined member clusters are selected. // +optional Policy *PlacementPolicy `json:"policy,omitempty"` // PolicyHash is the sha-256 hash value of the Policy field. // +required PolicyHash []byte `json:"policyHash"` }
SchedulingPolicySnapshotSpec defines the desired state of SchedulingPolicySnapshot.
func (*SchedulingPolicySnapshotSpec) DeepCopy ¶
func (in *SchedulingPolicySnapshotSpec) DeepCopy() *SchedulingPolicySnapshotSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulingPolicySnapshotSpec.
func (*SchedulingPolicySnapshotSpec) DeepCopyInto ¶
func (in *SchedulingPolicySnapshotSpec) DeepCopyInto(out *SchedulingPolicySnapshotSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SchedulingPolicySnapshotStatus ¶
type SchedulingPolicySnapshotStatus struct { // ObservedCRPGeneration is the generation of the CRP which the scheduler uses to perform // the scheduling cycle and prepare the scheduling status. // +required ObservedCRPGeneration int64 `json:"observedCRPGeneration"` // Conditions is an array of current observed conditions for SchedulingPolicySnapshot. // +optional Conditions []metav1.Condition `json:"conditions"` // +kubebuilder:validation:MaxItems=1000 // ClusterDecisions 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. // +optional ClusterDecisions []ClusterDecision `json:"targetClusters,omitempty"` }
SchedulingPolicySnapshotStatus defines the observed state of SchedulingPolicySnapshot.
func (*SchedulingPolicySnapshotStatus) DeepCopy ¶
func (in *SchedulingPolicySnapshotStatus) DeepCopy() *SchedulingPolicySnapshotStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulingPolicySnapshotStatus.
func (*SchedulingPolicySnapshotStatus) DeepCopyInto ¶
func (in *SchedulingPolicySnapshotStatus) DeepCopyInto(out *SchedulingPolicySnapshotStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServerSideApplyConfig ¶ added in v0.8.7
type ServerSideApplyConfig struct { // Force 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. // +optional ForceConflicts bool `json:"force"` }
ServerSideApplyConfig defines the configuration for server side apply. Details: https://kubernetes.io/docs/reference/using-api/server-side-apply/#conflicts
func (*ServerSideApplyConfig) DeepCopy ¶ added in v0.8.7
func (in *ServerSideApplyConfig) DeepCopy() *ServerSideApplyConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerSideApplyConfig.
func (*ServerSideApplyConfig) DeepCopyInto ¶ added in v0.8.7
func (in *ServerSideApplyConfig) DeepCopyInto(out *ServerSideApplyConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Toleration ¶ added in v0.8.7
type Toleration struct { // Key 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. // +optional Key string `json:"key,omitempty"` // Operator 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. // +kubebuilder:default=Equal // +kubebuilder:validation:Enum=Equal;Exists // +optional Operator corev1.TolerationOperator `json:"operator,omitempty"` // Value is the taint value the toleration matches to. // If the operator is Exists, the value should be empty, otherwise just a regular string. // +optional Value string `json:"value,omitempty"` // Effect indicates the taint effect to match. Empty means match all taint effects. // When specified, only allowed value is NoSchedule. // +kubebuilder:validation:Enum=NoSchedule // +optional Effect corev1.TaintEffect `json:"effect,omitempty"` }
Toleration allows ClusterResourcePlacement to tolerate any taint that matches the triple <key,value,effect> using the matching operator <operator>.
func (*Toleration) DeepCopy ¶ added in v0.8.9
func (in *Toleration) DeepCopy() *Toleration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Toleration.
func (*Toleration) DeepCopyInto ¶ added in v0.8.9
func (in *Toleration) DeepCopyInto(out *Toleration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TopologySpreadConstraint ¶
type TopologySpreadConstraint struct { // MaxSkew 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. // +kubebuilder:default=1 // +kubebuilder:validation:Minimum=1 // +optional MaxSkew *int32 `json:"maxSkew,omitempty"` // TopologyKey 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. // +required TopologyKey string `json:"topologyKey"` // WhenUnsatisfiable 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. // +optional WhenUnsatisfiable UnsatisfiableConstraintAction `json:"whenUnsatisfiable,omitempty"` }
TopologySpreadConstraint specifies how to spread resources among the given cluster topology.
func (*TopologySpreadConstraint) DeepCopy ¶
func (in *TopologySpreadConstraint) DeepCopy() *TopologySpreadConstraint
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologySpreadConstraint.
func (*TopologySpreadConstraint) DeepCopyInto ¶
func (in *TopologySpreadConstraint) DeepCopyInto(out *TopologySpreadConstraint)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UnsatisfiableConstraintAction ¶
type UnsatisfiableConstraintAction string
UnsatisfiableConstraintAction defines the type of actions that can be taken if a constraint is not satisfied. +enum
const ( // DoNotSchedule instructs the scheduler not to schedule the resource // onto the cluster when constraints are not satisfied. DoNotSchedule UnsatisfiableConstraintAction = "DoNotSchedule" // ScheduleAnyway instructs the scheduler to schedule the resource // even if constraints are not satisfied. ScheduleAnyway UnsatisfiableConstraintAction = "ScheduleAnyway" )
type Work ¶ added in v0.6.9
type Work struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // spec defines the workload of a work. // +optional Spec WorkSpec `json:"spec,omitempty"` // status defines the status of each applied manifest on the spoke cluster. Status WorkStatus `json:"status,omitempty"` }
Work is the Schema for the works API.
func (*Work) DeepCopy ¶ added in v0.6.9
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Work.
func (*Work) DeepCopyInto ¶ added in v0.6.9
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Work) DeepCopyObject ¶ added in v0.6.9
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type WorkList ¶ added in v0.6.9
type WorkList struct { metav1.TypeMeta `json:",inline"` // Standard list metadata. // +optional metav1.ListMeta `json:"metadata,omitempty"` // List of works. // +listType=set Items []Work `json:"items"` }
WorkList contains a list of Work.
func (*WorkList) DeepCopy ¶ added in v0.6.9
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkList.
func (*WorkList) DeepCopyInto ¶ added in v0.6.9
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*WorkList) DeepCopyObject ¶ added in v0.6.9
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type WorkResourceIdentifier ¶ added in v0.6.9
type WorkResourceIdentifier struct { // Ordinal represents an index in manifests list, so the condition can still be linked // to a manifest even thougth manifest cannot be parsed successfully. Ordinal int `json:"ordinal"` // Group is the group of the resource. Group string `json:"group,omitempty"` // Version is the version of the resource. Version string `json:"version,omitempty"` // Kind is the kind of the resource. Kind string `json:"kind,omitempty"` // Resource is the resource type of the resource Resource string `json:"resource,omitempty"` // Namespace is the namespace of the resource, the resource is cluster scoped if the value // is empty Namespace string `json:"namespace,omitempty"` // Name is the name of the resource Name string `json:"name,omitempty"` }
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.
func (*WorkResourceIdentifier) DeepCopy ¶ added in v0.6.9
func (in *WorkResourceIdentifier) DeepCopy() *WorkResourceIdentifier
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkResourceIdentifier.
func (*WorkResourceIdentifier) DeepCopyInto ¶ added in v0.6.9
func (in *WorkResourceIdentifier) DeepCopyInto(out *WorkResourceIdentifier)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkSpec ¶ added in v0.6.9
type WorkSpec struct { // Workload represents the manifest workload to be deployed on spoke cluster Workload WorkloadTemplate `json:"workload,omitempty"` // ApplyStrategy describes how to resolve the conflict if the resource to be placed already exists in the target cluster // and is owned by other appliers. // +optional ApplyStrategy *ApplyStrategy `json:"applyStrategy,omitempty"` }
WorkSpec defines the desired state of Work.
func (*WorkSpec) DeepCopy ¶ added in v0.6.9
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkSpec.
func (*WorkSpec) DeepCopyInto ¶ added in v0.6.9
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkStatus ¶ added in v0.6.9
type WorkStatus struct { // Conditions 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 trasitioning 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. Conditions []metav1.Condition `json:"conditions"` // ManifestConditions represents the conditions of each resource in work deployed on // spoke cluster. // +optional ManifestConditions []ManifestCondition `json:"manifestConditions,omitempty"` }
WorkStatus defines the observed state of Work.
func (*WorkStatus) DeepCopy ¶ added in v0.6.9
func (in *WorkStatus) DeepCopy() *WorkStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkStatus.
func (*WorkStatus) DeepCopyInto ¶ added in v0.6.9
func (in *WorkStatus) DeepCopyInto(out *WorkStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkloadTemplate ¶ added in v0.6.9
type WorkloadTemplate struct { // Manifests represents a list of kuberenetes resources to be deployed on the spoke cluster. // +optional Manifests []Manifest `json:"manifests,omitempty"` }
WorkloadTemplate represents the manifest workload to be deployed on spoke cluster
func (*WorkloadTemplate) DeepCopy ¶ added in v0.6.9
func (in *WorkloadTemplate) DeepCopy() *WorkloadTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadTemplate.
func (*WorkloadTemplate) DeepCopyInto ¶ added in v0.6.9
func (in *WorkloadTemplate) DeepCopyInto(out *WorkloadTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.