v1alpha2

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package v1alpha2 is the v1alpha2 version of the API. +k8s:deepcopy-gen=package,register +k8s:openapi-gen=true +groupName=work.karmada.io

Index

Constants

View Source
const (
	// ResourceKindResourceBinding is kind name of ResourceBinding.
	ResourceKindResourceBinding = "ResourceBinding"
	// ResourceSingularResourceBinding is singular name of ResourceBinding.
	ResourceSingularResourceBinding = "resourcebinding"
	// ResourcePluralResourceBinding is plural name of ResourceBinding.
	ResourcePluralResourceBinding = "resourcebindings"
	// ResourceNamespaceScopedResourceBinding indicates if ResourceBinding is NamespaceScoped.
	ResourceNamespaceScopedResourceBinding = true

	// ResourceKindClusterResourceBinding is kind name of ClusterResourceBinding.
	ResourceKindClusterResourceBinding = "ClusterResourceBinding"
	// ResourceSingularClusterResourceBinding is singular name of ClusterResourceBinding.
	ResourceSingularClusterResourceBinding = "clusterresourcebinding"
	// ResourcePluralClusterResourceBinding is kind plural of ClusterResourceBinding.
	ResourcePluralClusterResourceBinding = "clusterresourcebindings"
	// ResourceNamespaceScopedClusterResourceBinding indicates if ClusterResourceBinding is NamespaceScoped.
	ResourceNamespaceScopedClusterResourceBinding = false
)
View Source
const (
	// Scheduled represents the condition that the ResourceBinding or ClusterResourceBinding has been scheduled.
	Scheduled string = "Scheduled"

	// FullyApplied represents the condition that the resource referencing by ResourceBinding or ClusterResourceBinding
	// has been applied to all scheduled clusters.
	FullyApplied string = "FullyApplied"
)

Conditions definition

View Source
const (
	// EventReasonCleanupWorkFailed indicates that Cleanup work failed.
	EventReasonCleanupWorkFailed = "CleanupWorkFailed"
	// EventReasonSyncWorkFailed indicates that Sync work failed.
	EventReasonSyncWorkFailed = "SyncWorkFailed"
	// EventReasonSyncWorkSucceed indicates that Sync work succeed.
	EventReasonSyncWorkSucceed = "SyncWorkSucceed"
	// EventReasonAggregateStatusFailed indicates that aggregate status failed.
	EventReasonAggregateStatusFailed = "AggregateStatusFailed"
	// EventReasonAggregateStatusSucceed indicates that aggregate status succeed.
	EventReasonAggregateStatusSucceed = "AggregateStatusSucceed"
	// EventReasonApplyPolicyFailed indicates that apply policy for resource failed.
	EventReasonApplyPolicyFailed = "ApplyPolicyFailed"
	// EventReasonApplyPolicySucceed indicates that apply policy for resource succeed.
	EventReasonApplyPolicySucceed = "ApplyPolicySucceed"
	// EventReasonScheduleBindingFailed indicates that schedule binding failed.
	EventReasonScheduleBindingFailed = "ScheduleBindingFailed"
	// EventReasonScheduleBindingSucceed indicates that schedule binding succeed.
	EventReasonScheduleBindingSucceed = "ScheduleBindingSucceed"
	// EventReasonDescheduleBindingFailed indicates that deschedule binding failed.
	EventReasonDescheduleBindingFailed = "DescheduleBindingFailed"
	// EventReasonDescheduleBindingSucceed indicates that deschedule binding succeed.
	EventReasonDescheduleBindingSucceed = "DescheduleBindingSucceed"
)

Define events for ResourceBinding and ClusterResourceBinding objects.

View Source
const (
	// ResourceBindingReferenceKey is the key of ResourceBinding object.
	// It is usually a unique hash value of ResourceBinding object's namespace and name, intended to be added to the Work object.
	// It will be used to retrieve all Works objects that derived from a specific ResourceBinding object.
	ResourceBindingReferenceKey = "resourcebinding.karmada.io/key"

	// ClusterResourceBindingReferenceKey is the key of ClusterResourceBinding object.
	// It is usually a unique hash value of ClusterResourceBinding object's namespace and name, intended to be added to the Work object.
	// It will be used to retrieve all Works objects that derived by a specific ClusterResourceBinding object.
	ClusterResourceBindingReferenceKey = "clusterresourcebinding.karmada.io/key"

	// ResourceBindingNamespaceLabel is added to objects to specify associated ResourceBinding's namespace.
	ResourceBindingNamespaceLabel = "resourcebinding.karmada.io/namespace"

	// ResourceBindingNameLabel is added to objects to specify associated ResourceBinding's name.
	ResourceBindingNameLabel = "resourcebinding.karmada.io/name"

	// ClusterResourceBindingLabel is added to objects to specify associated ClusterResourceBinding.
	ClusterResourceBindingLabel = "clusterresourcebinding.karmada.io/name"

	// WorkNamespaceLabel is added to objects to specify associated Work's namespace.
	WorkNamespaceLabel = "work.karmada.io/namespace"

	// WorkNameLabel is added to objects to specify associated Work's name.
	WorkNameLabel = "work.karmada.io/name"
)
View Source
const (
	// ResourceConflictResolutionAnnotation is added to the resource template to specify how to resolve the conflict
	// in case of resource already existing in member clusters.
	// The valid value is:
	//   - overwrite: always overwrite the resource if already exist. The resource will be overwritten with the
	//     configuration from control plane.
	// Note: Propagation of the resource template without this annotation will fail in case of already exists.
	ResourceConflictResolutionAnnotation = "work.karmada.io/conflict-resolution"

	// ResourceConflictResolutionOverwrite is the value of ResourceConflictResolutionAnnotation, indicating the overwrite strategy.
	ResourceConflictResolutionOverwrite = "overwrite"
)

Define resource conflict resolution

View Source
const GroupName = "work.karmada.io"

GroupName specifies the group name used to register the objects.

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Depreciated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha2"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"}

SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AggregatedStatusItem

type AggregatedStatusItem struct {
	// ClusterName represents the member cluster name which the resource deployed on.
	// +required
	ClusterName string `json:"clusterName"`

	// Status reflects running status of current manifest.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Status *runtime.RawExtension `json:"status,omitempty"`
	// Applied represents if the resource referencing by ResourceBinding or ClusterResourceBinding
	// is successfully applied on the cluster.
	// +optional
	Applied bool `json:"applied,omitempty"`

	// AppliedMessage is a human readable message indicating details about the applied status.
	// This is usually holds the error message in case of apply failed.
	// +optional
	AppliedMessage string `json:"appliedMessage,omitempty"`
}

AggregatedStatusItem represents status of the resource running in a member cluster.

func (*AggregatedStatusItem) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggregatedStatusItem.

func (*AggregatedStatusItem) DeepCopyInto

func (in *AggregatedStatusItem) DeepCopyInto(out *AggregatedStatusItem)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BindingSnapshot added in v1.0.0

type BindingSnapshot struct {
	// Namespace represents the namespace of the Binding.
	// It is required for ResourceBinding.
	// If Namespace is not specified, means the referencing is ClusterResourceBinding.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Name represents the name of the Binding.
	// +required
	Name string `json:"name"`

	// Clusters represents the scheduled result.
	// +optional
	Clusters []TargetCluster `json:"clusters,omitempty"`
}

BindingSnapshot is a snapshot of a ResourceBinding or ClusterResourceBinding.

func (*BindingSnapshot) DeepCopy added in v1.1.0

func (in *BindingSnapshot) DeepCopy() *BindingSnapshot

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BindingSnapshot.

func (*BindingSnapshot) DeepCopyInto added in v1.1.0

func (in *BindingSnapshot) DeepCopyInto(out *BindingSnapshot)

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"`

	// Spec represents the desired behavior.
	Spec ResourceBindingSpec `json:"spec"`

	// Status represents the most recently observed status of the ResourceBinding.
	// +optional
	Status ResourceBindingStatus `json:"status,omitempty"`
}

ClusterResourceBinding represents a binding of a kubernetes resource with a ClusterPropagationPolicy.

func (*ClusterResourceBinding) DeepCopy

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) Hub

func (*ClusterResourceBinding) Hub()

Hub marks this type as a conversion hub.

type ClusterResourceBindingList

type ClusterResourceBindingList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is the list of ClusterResourceBinding.
	Items []ClusterResourceBinding `json:"items"`
}

ClusterResourceBindingList contains a list of ClusterResourceBinding.

func (*ClusterResourceBindingList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceBindingList.

func (*ClusterResourceBindingList) DeepCopyInto

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 NodeClaim

type NodeClaim struct {
	// A node selector represents the union of the results of one or more label queries over a set of
	// nodes; that is, it represents the OR of the selectors represented by the node selector terms.
	// Note that only PodSpec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution
	// is included here because it has a hard limit on pod scheduling.
	// +optional
	HardNodeAffinity *corev1.NodeSelector `json:"hardNodeAffinity,omitempty"`
	// NodeSelector is a selector which must be true for the pod to fit on a node.
	// Selector which must match a node's labels for the pod to be scheduled on that node.
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// If specified, the pod's tolerations.
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

NodeClaim represents the node claim HardNodeAffinity, NodeSelector and Tolerations required by each replica.

func (*NodeClaim) DeepCopy

func (in *NodeClaim) DeepCopy() *NodeClaim

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeClaim.

func (*NodeClaim) DeepCopyInto

func (in *NodeClaim) DeepCopyInto(out *NodeClaim)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ObjectReference

type ObjectReference struct {
	// APIVersion represents the API version of the referent.
	APIVersion string `json:"apiVersion"`

	// Kind represents the Kind of the referent.
	Kind string `json:"kind"`

	// Namespace represents the namespace for the referent.
	// For non-namespace scoped resources(e.g. 'ClusterRole'),do not need specify Namespace,
	// and for namespace scoped resources, Namespace is required.
	// If Namespace is not specified, means the resource is non-namespace scoped.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Name represents the name of the referent.
	Name string `json:"name"`

	// UID of the referent.
	// +optional
	UID types.UID `json:"uid,omitempty"`

	// ResourceVersion represents the internal version of the referenced object, that can be used by clients to
	// determine when object has changed.
	// +optional
	ResourceVersion string `json:"resourceVersion,omitempty"`
}

ObjectReference contains enough information to locate the referenced object inside current cluster.

func (*ObjectReference) DeepCopy

func (in *ObjectReference) DeepCopy() *ObjectReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference.

func (*ObjectReference) DeepCopyInto

func (in *ObjectReference) DeepCopyInto(out *ObjectReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReplicaRequirements

type ReplicaRequirements struct {
	// NodeClaim represents the node claim HardNodeAffinity, NodeSelector and Tolerations required by each replica.
	// +optional
	NodeClaim *NodeClaim `json:"nodeClaim,omitempty"`

	// ResourceRequest represents the resources required by each replica.
	// +optional
	ResourceRequest corev1.ResourceList `json:"resourceRequest,omitempty"`
}

ReplicaRequirements represents the requirements required by each replica.

func (*ReplicaRequirements) DeepCopy

func (in *ReplicaRequirements) DeepCopy() *ReplicaRequirements

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaRequirements.

func (*ReplicaRequirements) DeepCopyInto

func (in *ReplicaRequirements) DeepCopyInto(out *ReplicaRequirements)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceBinding

type ResourceBinding struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec represents the desired behavior.
	Spec ResourceBindingSpec `json:"spec"`

	// Status represents the most recently observed status of the ResourceBinding.
	// +optional
	Status ResourceBindingStatus `json:"status,omitempty"`
}

ResourceBinding represents a binding of a kubernetes resource with a propagation policy.

func (*ResourceBinding) DeepCopy

func (in *ResourceBinding) DeepCopy() *ResourceBinding

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceBinding.

func (*ResourceBinding) DeepCopyInto

func (in *ResourceBinding) DeepCopyInto(out *ResourceBinding)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceBinding) DeepCopyObject

func (in *ResourceBinding) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ResourceBinding) Hub

func (*ResourceBinding) Hub()

Hub marks this type as a conversion hub.

type ResourceBindingList

type ResourceBindingList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is the list of ResourceBinding.
	Items []ResourceBinding `json:"items"`
}

ResourceBindingList contains a list of ResourceBinding.

func (*ResourceBindingList) DeepCopy

func (in *ResourceBindingList) DeepCopy() *ResourceBindingList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceBindingList.

func (*ResourceBindingList) DeepCopyInto

func (in *ResourceBindingList) DeepCopyInto(out *ResourceBindingList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceBindingList) DeepCopyObject

func (in *ResourceBindingList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceBindingSpec

type ResourceBindingSpec struct {
	// Resource represents the Kubernetes resource to be propagated.
	Resource ObjectReference `json:"resource"`

	// PropagateDeps tells if relevant resources should be propagated automatically.
	// It is inherited from PropagationPolicy or ClusterPropagationPolicy.
	// default false.
	// +optional
	PropagateDeps bool `json:"propagateDeps,omitempty"`

	// ReplicaRequirements represents the requirements required by each replica.
	// +optional
	ReplicaRequirements *ReplicaRequirements `json:"replicaRequirements,omitempty"`

	// Replicas represents the replica number of the referencing resource.
	// +optional
	Replicas int32 `json:"replicas,omitempty"`

	// Clusters represents target member clusters where the resource to be deployed.
	// +optional
	Clusters []TargetCluster `json:"clusters,omitempty"`

	// RequiredBy represents the list of Bindings that depend on the referencing resource.
	// +optional
	RequiredBy []BindingSnapshot `json:"requiredBy,omitempty"`
}

ResourceBindingSpec represents the expectation of ResourceBinding.

func (*ResourceBindingSpec) AssignedReplicasForCluster added in v1.2.0

func (s *ResourceBindingSpec) AssignedReplicasForCluster(targetCluster string) int32

AssignedReplicasForCluster returns assigned replicas for specific cluster.

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.

func (*ResourceBindingSpec) TargetContains added in v1.2.0

func (s *ResourceBindingSpec) TargetContains(name string) bool

TargetContains checks if specific cluster present on the target list.

type ResourceBindingStatus

type ResourceBindingStatus struct {
	// Conditions contain the different condition statuses.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// AggregatedStatus represents status list of the resource running in each member cluster.
	// +optional
	AggregatedStatus []AggregatedStatusItem `json:"aggregatedStatus,omitempty"`
}

ResourceBindingStatus represents the overall status of the strategy as well as the referenced resources.

func (*ResourceBindingStatus) DeepCopy

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 TargetCluster

type TargetCluster struct {
	// Name of target cluster.
	Name string `json:"name"`
	// Replicas in target cluster
	// +optional
	Replicas int32 `json:"replicas,omitempty"`
}

TargetCluster represents the identifier of a member cluster.

func (*TargetCluster) DeepCopy

func (in *TargetCluster) DeepCopy() *TargetCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetCluster.

func (*TargetCluster) DeepCopyInto

func (in *TargetCluster) DeepCopyInto(out *TargetCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL