v1alpha1

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 16

Documentation

Overview

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

Index

Constants

View Source
const (
	// ResourceKindFederatedResourceQuota is kind name of FederatedResourceQuota.
	ResourceKindFederatedResourceQuota = "FederatedResourceQuota"
	// ResourceSingularFederatedResourceQuota is singular name of FederatedResourceQuota.
	ResourceSingularFederatedResourceQuota = "federatedresourcequota"
	// ResourcePluralFederatedResourceQuota is plural name of FederatedResourceQuota.
	ResourcePluralFederatedResourceQuota = "federatedresourcequotas"
	// ResourceNamespaceScopedFederatedResourceQuota indicates if FederatedResourceQuota is NamespaceScoped.
	ResourceNamespaceScopedFederatedResourceQuota = true
)
View Source
const (
	// ResourceKindOverridePolicy is kind name of OverridePolicy.
	ResourceKindOverridePolicy = "OverridePolicy"
	// ResourceSingularOverridePolicy is singular name of OverridePolicy.
	ResourceSingularOverridePolicy = "overridepolicy"
	// ResourcePluralOverridePolicy is plural name of OverridePolicy.
	ResourcePluralOverridePolicy = "overridepolicies"
	// ResourceNamespaceScopedOverridePolicy indicates if OverridePolicy is NamespaceScoped.
	ResourceNamespaceScopedOverridePolicy = true

	// ResourceKindClusterOverridePolicy is kind name of ClusterOverridePolicy.
	ResourceKindClusterOverridePolicy = "ClusterOverridePolicy"
	// ResourceSingularClusterOverridePolicy is singular name of ClusterOverridePolicy.
	ResourceSingularClusterOverridePolicy = "clusteroverridepolicy"
	// ResourcePluralClusterOverridePolicy is kind plural of ClusterOverridePolicy.
	ResourcePluralClusterOverridePolicy = "clusteroverridepolicies"
	// ResourceNamespaceScopedClusterOverridePolicy indicates if ClusterOverridePolicy is NamespaceScoped.
	ResourceNamespaceScopedClusterOverridePolicy = false
)
View Source
const (
	// ResourceKindPropagationPolicy is kind name of PropagationPolicy.
	ResourceKindPropagationPolicy = "PropagationPolicy"
	// ResourceSingularPropagationPolicy is singular name of PropagationPolicy.
	ResourceSingularPropagationPolicy = "propagationpolicy"
	// ResourcePluralPropagationPolicy is kind plural name of PropagationPolicy.
	ResourcePluralPropagationPolicy = "propagationpolicies"
	// ResourceNamespaceScopedPropagationPolicy indicates if PropagationPolicy is NamespaceScoped.
	ResourceNamespaceScopedPropagationPolicy = true

	// ResourceKindClusterPropagationPolicy is kind name of ClusterPropagationPolicy.
	ResourceKindClusterPropagationPolicy = "ClusterPropagationPolicy"
	// ResourceSingularClusterPropagationPolicy is singular name of ClusterPropagationPolicy.
	ResourceSingularClusterPropagationPolicy = "clusterpropagationpolicy"
	// ResourcePluralClusterPropagationPolicy is plural name of ClusterPropagationPolicy.
	ResourcePluralClusterPropagationPolicy = "clusterpropagationpolicies"
	// ResourceNamespaceScopedClusterPropagationPolicy indicates if ClusterPropagationPolicy is NamespaceScoped.
	ResourceNamespaceScopedClusterPropagationPolicy = false
)
View Source
const (
	// PropagationPolicyPermanentIDLabel is the identifier of a PropagationPolicy object.
	// Karmada generates a unique identifier, such as metadata.UUID, for each PropagationPolicy object.
	// This identifier will be used as a label selector to locate corresponding resources, such as ResourceBinding.
	// The reason for generating a new unique identifier instead of simply using metadata.UUID is because:
	// In backup scenarios, when applying the backup resource manifest in a new cluster, the UUID may change.
	PropagationPolicyPermanentIDLabel = "propagationpolicy.karmada.io/permanent-id"

	// ClusterPropagationPolicyPermanentIDLabel is the identifier of a ClusterPropagationPolicy object.
	// Karmada generates a unique identifier, such as metadata.UUID, for each ClusterPropagationPolicy object.
	// This identifier will be used as a label selector to locate corresponding resources, such as ResourceBinding.
	// The reason for generating a new unique identifier instead of simply using metadata.UUID is because:
	// In backup scenarios, when applying the backup resource manifest in a new cluster, the UUID may change.
	ClusterPropagationPolicyPermanentIDLabel = "clusterpropagationpolicy.karmada.io/permanent-id"

	// PropagationPolicyUIDLabel is the uid of PropagationPolicy object.
	PropagationPolicyUIDLabel = "propagationpolicy.karmada.io/uid"

	// PropagationPolicyNamespaceAnnotation is added to objects to specify associated PropagationPolicy namespace.
	PropagationPolicyNamespaceAnnotation = "propagationpolicy.karmada.io/namespace"

	// PropagationPolicyNameAnnotation is added to objects to specify associated PropagationPolicy name.
	PropagationPolicyNameAnnotation = "propagationpolicy.karmada.io/name"

	// ClusterPropagationPolicyUIDLabel is the uid of ClusterPropagationPolicy object.
	ClusterPropagationPolicyUIDLabel = "clusterpropagationpolicy.karmada.io/uid"

	// ClusterPropagationPolicyAnnotation is added to objects to specify associated ClusterPropagationPolicy name.
	ClusterPropagationPolicyAnnotation = "clusterpropagationpolicy.karmada.io/name"

	// PropagationPolicyNamespaceLabel is added to objects to specify associated PropagationPolicy namespace.
	PropagationPolicyNamespaceLabel = "propagationpolicy.karmada.io/namespace"

	// PropagationPolicyNameLabel is added to objects to specify associated PropagationPolicy's name.
	PropagationPolicyNameLabel = "propagationpolicy.karmada.io/name"

	// ClusterPropagationPolicyLabel is added to objects to specify associated ClusterPropagationPolicy.
	ClusterPropagationPolicyLabel = "clusterpropagationpolicy.karmada.io/name"

	// NamespaceSkipAutoPropagationLabel is added to namespace objects to indicate if
	// the namespace should be skipped from propagating by the namespace controller.
	// For example, a namespace with the following label will be skipped:
	//   labels:
	//     namespace.karmada.io/skip-auto-propagation: "true"
	//
	// NOTE: If create a ns without this label, then patch it with this label, the ns will not be
	// synced to new member clusters, but old member clusters still have it.
	NamespaceSkipAutoPropagationLabel = "namespace.karmada.io/skip-auto-propagation"
)
View Source
const GroupName = "policy.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: "v1alpha1"}

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

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

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 ActivationPreference added in v1.9.0

type ActivationPreference string

ActivationPreference indicates how the referencing resource template will be propagated, in case of policy changes.

const (
	// LazyActivation means the policy changes will not take effect for now but defer to the resource template changes,
	// in other words, the resource template will not be propagated as per the current propagation rules until
	// there is an update on it.
	LazyActivation ActivationPreference = "Lazy"
)

type ApplicationFailoverBehavior added in v1.6.0

type ApplicationFailoverBehavior struct {
	// DecisionConditions indicates the decision conditions of performing the failover process.
	// Only when all conditions are met can the failover process be performed.
	// Currently, DecisionConditions includes several conditions:
	// - TolerationSeconds (optional)
	// +required
	DecisionConditions DecisionConditions `json:"decisionConditions"`

	// PurgeMode represents how to deal with the legacy applications on the
	// cluster from which the application is migrated.
	// Valid options are "Immediately", "Graciously" and "Never".
	// Defaults to "Graciously".
	// +kubebuilder:default=Graciously
	// +optional
	PurgeMode PurgeMode `json:"purgeMode,omitempty"`

	// GracePeriodSeconds is the maximum waiting duration in seconds before
	// application on the migrated cluster should be deleted.
	// Required only when PurgeMode is "Graciously" and defaults to 600s.
	// If the application on the new cluster cannot reach a Healthy state,
	// Karmada will delete the application after GracePeriodSeconds is reached.
	// Value must be positive integer.
	// +optional
	GracePeriodSeconds *int32 `json:"gracePeriodSeconds,omitempty"`
}

ApplicationFailoverBehavior indicates application failover behaviors.

func (*ApplicationFailoverBehavior) DeepCopy added in v1.6.0

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

func (*ApplicationFailoverBehavior) DeepCopyInto added in v1.6.0

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

type ClusterAffinity

type ClusterAffinity struct {
	// LabelSelector is a filter to select member clusters by labels.
	// If non-nil and non-empty, only the clusters match this filter will be selected.
	// +optional
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`

	// FieldSelector is a filter to select member clusters by fields.
	// The key(field) of the match expression should be 'provider', 'region', or 'zone',
	// and the operator of the match expression should be 'In' or 'NotIn'.
	// If non-nil and non-empty, only the clusters match this filter will be selected.
	// +optional
	FieldSelector *FieldSelector `json:"fieldSelector,omitempty"`

	// ClusterNames is the list of clusters to be selected.
	// +optional
	ClusterNames []string `json:"clusterNames,omitempty"`

	// ExcludedClusters is the list of clusters to be ignored.
	// +optional
	ExcludeClusters []string `json:"exclude,omitempty"`
}

ClusterAffinity represents the filter to select clusters.

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 ClusterAffinityTerm added in v1.5.0

type ClusterAffinityTerm struct {
	// AffinityName is the name of the cluster group.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=32
	// +required
	AffinityName string `json:"affinityName"`

	ClusterAffinity `json:",inline"`
}

ClusterAffinityTerm selects a set of cluster.

func (*ClusterAffinityTerm) DeepCopy added in v1.5.0

func (in *ClusterAffinityTerm) DeepCopy() *ClusterAffinityTerm

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

func (*ClusterAffinityTerm) DeepCopyInto added in v1.5.0

func (in *ClusterAffinityTerm) DeepCopyInto(out *ClusterAffinityTerm)

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

type ClusterOverridePolicy added in v0.4.0

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

	// Spec represents the desired behavior of ClusterOverridePolicy.
	Spec OverrideSpec `json:"spec"`
}

ClusterOverridePolicy represents the cluster-wide policy that overrides a group of resources to one or more clusters.

func (*ClusterOverridePolicy) DeepCopy added in v0.4.0

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

func (*ClusterOverridePolicy) DeepCopyInto added in v0.4.0

func (in *ClusterOverridePolicy) DeepCopyInto(out *ClusterOverridePolicy)

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

func (*ClusterOverridePolicy) DeepCopyObject added in v0.4.0

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

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

func (*ClusterOverridePolicy) GetName added in v1.0.0

func (p *ClusterOverridePolicy) GetName() string

GetName returns the name of ClusterOverridePolicy

func (*ClusterOverridePolicy) GetNamespace added in v1.0.0

func (p *ClusterOverridePolicy) GetNamespace() string

GetNamespace returns the namespace of ClusterOverridePolicy

func (*ClusterOverridePolicy) GetOverrideSpec added in v1.0.0

func (p *ClusterOverridePolicy) GetOverrideSpec() OverrideSpec

GetOverrideSpec returns the OverrideSpec of ClusterOverridePolicy

type ClusterOverridePolicyList added in v0.4.0

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

	// Items holds a list of ClusterOverridePolicy.
	Items []ClusterOverridePolicy `json:"items"`
}

ClusterOverridePolicyList is a collection of ClusterOverridePolicy.

func (*ClusterOverridePolicyList) DeepCopy added in v0.4.0

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

func (*ClusterOverridePolicyList) DeepCopyInto added in v0.4.0

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

func (*ClusterOverridePolicyList) DeepCopyObject added in v0.4.0

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

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

type ClusterPreferences added in v0.5.0

type ClusterPreferences struct {
	// StaticWeightList defines the static cluster weight.
	// +optional
	StaticWeightList []StaticClusterWeight `json:"staticWeightList,omitempty"`
	// DynamicWeight specifies the factor to generates dynamic weight list.
	// If specified, StaticWeightList will be ignored.
	// +kubebuilder:validation:Enum=AvailableReplicas
	// +optional
	DynamicWeight DynamicWeightFactor `json:"dynamicWeight,omitempty"`
}

ClusterPreferences describes weight for each cluster or for each group of cluster.

func (*ClusterPreferences) DeepCopy added in v0.5.0

func (in *ClusterPreferences) DeepCopy() *ClusterPreferences

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

func (*ClusterPreferences) DeepCopyInto added in v0.5.0

func (in *ClusterPreferences) DeepCopyInto(out *ClusterPreferences)

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

type ClusterPropagationPolicy added in v0.4.0

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

	// Spec represents the desired behavior of ClusterPropagationPolicy.
	// +required
	Spec PropagationSpec `json:"spec"`
}

ClusterPropagationPolicy represents the cluster-wide policy that propagates a group of resources to one or more clusters. Different with PropagationPolicy that could only propagate resources in its own namespace, ClusterPropagationPolicy is able to propagate cluster level resources and resources in any namespace other than system reserved ones. System reserved namespaces are: karmada-system, karmada-cluster, karmada-es-*.

func (*ClusterPropagationPolicy) DeepCopy added in v0.4.0

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

func (*ClusterPropagationPolicy) DeepCopyInto added in v0.4.0

func (in *ClusterPropagationPolicy) DeepCopyInto(out *ClusterPropagationPolicy)

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

func (*ClusterPropagationPolicy) DeepCopyObject added in v0.4.0

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

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

func (*ClusterPropagationPolicy) ExplicitPriority added in v1.4.0

func (p *ClusterPropagationPolicy) ExplicitPriority() int32

ExplicitPriority returns the explicit priority of a ClusterPropagationPolicy.

type ClusterPropagationPolicyList added in v0.4.0

type ClusterPropagationPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterPropagationPolicy `json:"items"`
}

ClusterPropagationPolicyList contains a list of ClusterPropagationPolicy.

func (*ClusterPropagationPolicyList) DeepCopy added in v0.4.0

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

func (*ClusterPropagationPolicyList) DeepCopyInto added in v0.4.0

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

func (*ClusterPropagationPolicyList) DeepCopyObject added in v0.4.0

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

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

type ClusterQuotaStatus added in v1.1.0

type ClusterQuotaStatus struct {
	// ClusterName is the name of the cluster the limits enforce to.
	// +required
	ClusterName string `json:"clusterName"`

	corev1.ResourceQuotaStatus `json:",inline"`
}

ClusterQuotaStatus represents the set of desired limits and observed usage for a specific cluster.

func (*ClusterQuotaStatus) DeepCopy added in v1.1.0

func (in *ClusterQuotaStatus) DeepCopy() *ClusterQuotaStatus

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

func (*ClusterQuotaStatus) DeepCopyInto added in v1.1.0

func (in *ClusterQuotaStatus) DeepCopyInto(out *ClusterQuotaStatus)

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

type CommandArgsOverrider added in v0.8.0

type CommandArgsOverrider struct {
	// The name of container
	// +required
	ContainerName string `json:"containerName"`

	// Operator represents the operator which will apply on the command/args.
	// +kubebuilder:validation:Enum=add;remove
	// +required
	Operator OverriderOperator `json:"operator"`

	// Value to be applied to command/args.
	// Items in Value which will be appended after command/args when Operator is 'add'.
	// Items in Value which match in command/args will be deleted when Operator is 'remove'.
	// If Value is empty, then the command/args will remain the same.
	// +optional
	Value []string `json:"value,omitempty"`
}

CommandArgsOverrider represents the rules dedicated to handling command/args overrides.

func (*CommandArgsOverrider) DeepCopy added in v0.9.0

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

func (*CommandArgsOverrider) DeepCopyInto added in v0.9.0

func (in *CommandArgsOverrider) DeepCopyInto(out *CommandArgsOverrider)

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

type ConflictResolution added in v1.7.0

type ConflictResolution string

ConflictResolution describes how to resolve the conflict during the process of propagation especially the resource already in a member cluster.

const (
	// ConflictOverwrite means that resolve the conflict by overwriting the
	// resource with the propagating resource template.
	ConflictOverwrite ConflictResolution = "Overwrite"

	// ConflictAbort means that do not resolve the conflict and stop propagating.
	ConflictAbort ConflictResolution = "Abort"
)

type DecisionConditions added in v1.6.0

type DecisionConditions struct {
	// TolerationSeconds represents the period of time Karmada should wait
	// after reaching the desired state before performing failover process.
	// If not specified, Karmada will immediately perform failover process.
	// Defaults to 300s.
	// +kubebuilder:default=300
	// +optional
	TolerationSeconds *int32 `json:"tolerationSeconds,omitempty"`
}

DecisionConditions represents the decision conditions of performing the failover process.

func (*DecisionConditions) DeepCopy added in v1.6.0

func (in *DecisionConditions) DeepCopy() *DecisionConditions

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

func (*DecisionConditions) DeepCopyInto added in v1.6.0

func (in *DecisionConditions) DeepCopyInto(out *DecisionConditions)

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

type DynamicWeightFactor added in v0.10.0

type DynamicWeightFactor string

DynamicWeightFactor represents the weight factor. For now only support 'AvailableReplicas', more factors could be extended if there is a need.

const (
	// DynamicWeightByAvailableReplicas represents the cluster weight list should be generated according to
	// available resource (available replicas).
	// Example:
	//   The scheduler selected 3 clusters (A/B/C) and should divide 12 replicas to them.
	//   Workload:
	//     Desired replica: 12
	//   Cluster:
	//     A: Max available replica: 6
	//     B: Max available replica: 12
	//     C: Max available replica: 18
	//   The weight of cluster A:B:C will be 6:12:18 (equals to 1:2:3). At last, the assignment would be 'A: 2, B: 4, C: 6'.
	DynamicWeightByAvailableReplicas DynamicWeightFactor = "AvailableReplicas"
)

type FailoverBehavior added in v1.6.0

type FailoverBehavior struct {
	// Application indicates failover behaviors in case of application failure.
	// If this value is nil, failover is disabled.
	// If set, the PropagateDeps should be true so that the dependencies could
	// be migrated along with the application.
	// +optional
	Application *ApplicationFailoverBehavior `json:"application,omitempty"`
}

FailoverBehavior indicates failover behaviors in case of an application or cluster failure.

func (*FailoverBehavior) DeepCopy added in v1.6.0

func (in *FailoverBehavior) DeepCopy() *FailoverBehavior

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

func (*FailoverBehavior) DeepCopyInto added in v1.6.0

func (in *FailoverBehavior) DeepCopyInto(out *FailoverBehavior)

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

type FederatedResourceQuota added in v1.1.0

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

	// Spec defines the desired quota.
	// +required
	Spec FederatedResourceQuotaSpec `json:"spec"`

	// Status defines the actual enforced quota and its current usage.
	// +optional
	Status FederatedResourceQuotaStatus `json:"status,omitempty"`
}

FederatedResourceQuota sets aggregate quota restrictions enforced per namespace across all clusters.

func (*FederatedResourceQuota) DeepCopy added in v1.1.0

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

func (*FederatedResourceQuota) DeepCopyInto added in v1.1.0

func (in *FederatedResourceQuota) DeepCopyInto(out *FederatedResourceQuota)

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

func (*FederatedResourceQuota) DeepCopyObject added in v1.1.0

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

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

type FederatedResourceQuotaList added in v1.1.0

type FederatedResourceQuotaList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []FederatedResourceQuota `json:"items"`
}

FederatedResourceQuotaList contains a list of FederatedResourceQuota.

func (*FederatedResourceQuotaList) DeepCopy added in v1.1.0

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

func (*FederatedResourceQuotaList) DeepCopyInto added in v1.1.0

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

func (*FederatedResourceQuotaList) DeepCopyObject added in v1.1.0

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

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

type FederatedResourceQuotaSpec added in v1.1.0

type FederatedResourceQuotaSpec struct {
	// Overall is the set of desired hard limits for each named resource.
	// +required
	Overall corev1.ResourceList `json:"overall"`

	// StaticAssignments represents the subset of desired hard limits for each cluster.
	// Note: for clusters not present in this list, Karmada will set an empty ResourceQuota to them, which means these
	// clusters will have no quotas in the referencing namespace.
	// +optional
	StaticAssignments []StaticClusterAssignment `json:"staticAssignments,omitempty"`
}

FederatedResourceQuotaSpec defines the desired hard limits to enforce for Quota.

func (*FederatedResourceQuotaSpec) DeepCopy added in v1.1.0

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

func (*FederatedResourceQuotaSpec) DeepCopyInto added in v1.1.0

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

type FederatedResourceQuotaStatus added in v1.1.0

type FederatedResourceQuotaStatus struct {
	// Overall is the set of enforced hard limits for each named resource.
	// +optional
	Overall corev1.ResourceList `json:"overall,omitempty"`

	// OverallUsed is the current observed total usage of the resource in the namespace.
	// +optional
	OverallUsed corev1.ResourceList `json:"overallUsed,omitempty"`

	// AggregatedStatus is the observed quota usage of each cluster.
	// +optional
	AggregatedStatus []ClusterQuotaStatus `json:"aggregatedStatus,omitempty"`
}

FederatedResourceQuotaStatus defines the enforced hard limits and observed use.

func (*FederatedResourceQuotaStatus) DeepCopy added in v1.1.0

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

func (*FederatedResourceQuotaStatus) DeepCopyInto added in v1.1.0

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

type FieldSelector

type FieldSelector struct {
	// A list of field selector requirements.
	MatchExpressions []corev1.NodeSelectorRequirement `json:"matchExpressions,omitempty"`
}

FieldSelector is a field filter.

func (*FieldSelector) DeepCopy

func (in *FieldSelector) DeepCopy() *FieldSelector

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

func (*FieldSelector) DeepCopyInto

func (in *FieldSelector) DeepCopyInto(out *FieldSelector)

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

type ImageComponent added in v0.5.0

type ImageComponent string

ImageComponent indicates the components for image.

const (
	// Registry is the registry component of an image with format '[registry/]repository[:tag]'.
	Registry ImageComponent = "Registry"

	// Repository is the repository component of an image with format '[registry/]repository[:tag]'.
	Repository ImageComponent = "Repository"

	// Tag is the tag component of an image with format '[registry/]repository[:tag]'.
	Tag ImageComponent = "Tag"
)

type ImageOverrider added in v0.5.0

type ImageOverrider struct {
	// Predicate filters images before applying the rule.
	//
	// Defaults to nil, in that case, the system will automatically detect image fields if the resource type is
	// Pod, ReplicaSet, Deployment, StatefulSet, DaemonSet or Job by following rule:
	//   - Pod: /spec/containers/<N>/image
	//   - ReplicaSet: /spec/template/spec/containers/<N>/image
	//   - Deployment: /spec/template/spec/containers/<N>/image
	//   - DaemonSet: /spec/template/spec/containers/<N>/image
	//   - StatefulSet: /spec/template/spec/containers/<N>/image
	//   - Job: /spec/template/spec/containers/<N>/image
	// In addition, all images will be processed if the resource object has more than one container.
	//
	// If not nil, only images matches the filters will be processed.
	// +optional
	Predicate *ImagePredicate `json:"predicate,omitempty"`

	// Component is part of image name.
	// Basically we presume an image can be made of '[registry/]repository[:tag]'.
	// The registry could be:
	// - registry.k8s.io
	// - fictional.registry.example:10443
	// The repository could be:
	// - kube-apiserver
	// - fictional/nginx
	// The tag cloud be:
	// - latest
	// - v1.19.1
	// - @sha256:dbcc1c35ac38df41fd2f5e4130b32ffdb93ebae8b3dbe638c23575912276fc9c
	//
	// +kubebuilder:validation:Enum=Registry;Repository;Tag
	// +required
	Component ImageComponent `json:"component"`

	// Operator represents the operator which will apply on the image.
	// +kubebuilder:validation:Enum=add;remove;replace
	// +required
	Operator OverriderOperator `json:"operator"`

	// Value to be applied to image.
	// Must not be empty when operator is 'add' or 'replace'.
	// Defaults to empty and ignored when operator is 'remove'.
	// +optional
	Value string `json:"value,omitempty"`
}

ImageOverrider represents the rules dedicated to handling image overrides.

func (*ImageOverrider) DeepCopy added in v0.5.0

func (in *ImageOverrider) DeepCopy() *ImageOverrider

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

func (*ImageOverrider) DeepCopyInto added in v0.5.0

func (in *ImageOverrider) DeepCopyInto(out *ImageOverrider)

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

type ImagePredicate added in v0.5.0

type ImagePredicate struct {
	// Path indicates the path of target field
	// +required
	Path string `json:"path"`
}

ImagePredicate describes images filter.

func (*ImagePredicate) DeepCopy added in v0.5.0

func (in *ImagePredicate) DeepCopy() *ImagePredicate

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

func (*ImagePredicate) DeepCopyInto added in v0.5.0

func (in *ImagePredicate) DeepCopyInto(out *ImagePredicate)

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

type LabelAnnotationOverrider added in v1.4.0

type LabelAnnotationOverrider struct {
	// Operator represents the operator which will apply on the workload.
	// +kubebuilder:validation:Enum=add;remove;replace
	// +required
	Operator OverriderOperator `json:"operator"`

	// Value to be applied to annotations/labels of workload.
	// Items in Value which will be appended after annotations/labels when Operator is 'add'.
	// Items in Value which match in annotations/labels will be deleted when Operator is 'remove'.
	// Items in Value which match in annotations/labels will be replaced when Operator is 'replace'.
	// +required
	Value map[string]string `json:"value,omitempty"`
}

LabelAnnotationOverrider represents the rules dedicated to handling workload labels/annotations

func (*LabelAnnotationOverrider) DeepCopy added in v1.4.0

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

func (*LabelAnnotationOverrider) DeepCopyInto added in v1.4.0

func (in *LabelAnnotationOverrider) DeepCopyInto(out *LabelAnnotationOverrider)

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

type OverridePolicy

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

	// Spec represents the desired behavior of OverridePolicy.
	Spec OverrideSpec `json:"spec"`
}

OverridePolicy represents the policy that overrides a group of resources to one or more clusters.

func (*OverridePolicy) DeepCopy

func (in *OverridePolicy) DeepCopy() *OverridePolicy

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

func (*OverridePolicy) DeepCopyInto

func (in *OverridePolicy) DeepCopyInto(out *OverridePolicy)

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

func (*OverridePolicy) DeepCopyObject

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

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

func (*OverridePolicy) GetName added in v1.0.0

func (p *OverridePolicy) GetName() string

GetName returns the name of OverridePolicy

func (*OverridePolicy) GetNamespace added in v1.0.0

func (p *OverridePolicy) GetNamespace() string

GetNamespace returns the namespace of OverridePolicy

func (*OverridePolicy) GetOverrideSpec added in v1.0.0

func (p *OverridePolicy) GetOverrideSpec() OverrideSpec

GetOverrideSpec returns the OverrideSpec of OverridePolicy

type OverridePolicyList

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

	// Items holds a list of OverridePolicy.
	Items []OverridePolicy `json:"items"`
}

OverridePolicyList is a collection of OverridePolicy.

func (*OverridePolicyList) DeepCopy

func (in *OverridePolicyList) DeepCopy() *OverridePolicyList

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

func (*OverridePolicyList) DeepCopyInto

func (in *OverridePolicyList) DeepCopyInto(out *OverridePolicyList)

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

func (*OverridePolicyList) DeepCopyObject

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

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

type OverrideSpec

type OverrideSpec struct {
	// ResourceSelectors restricts resource types that this override policy applies to.
	// nil means matching all resources.
	// +optional
	ResourceSelectors []ResourceSelector `json:"resourceSelectors,omitempty"`

	// OverrideRules defines a collection of override rules on target clusters.
	// +optional
	OverrideRules []RuleWithCluster `json:"overrideRules,omitempty"`

	// TargetCluster defines restrictions on this override policy
	// that only applies to resources propagated to the matching clusters.
	// nil means matching all clusters.
	//
	// Deprecated: This filed is deprecated in v1.0 and please use the OverrideRules instead.
	// +optional
	TargetCluster *ClusterAffinity `json:"targetCluster,omitempty"`

	// Overriders represents the override rules that would apply on resources
	//
	// Deprecated: This filed is deprecated in v1.0 and please use the OverrideRules instead.
	// +optional
	Overriders Overriders `json:"overriders"`
}

OverrideSpec defines the desired behavior of OverridePolicy.

func (*OverrideSpec) DeepCopy

func (in *OverrideSpec) DeepCopy() *OverrideSpec

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

func (*OverrideSpec) DeepCopyInto

func (in *OverrideSpec) DeepCopyInto(out *OverrideSpec)

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

type OverriderOperator

type OverriderOperator string

OverriderOperator is the set of operators that can be used in an overrider.

const (
	OverriderOpAdd     OverriderOperator = "add"
	OverriderOpRemove  OverriderOperator = "remove"
	OverriderOpReplace OverriderOperator = "replace"
)

These are valid overrider operators.

type Overriders

type Overriders struct {
	// Plaintext represents override rules defined with plaintext overriders.
	// +optional
	Plaintext []PlaintextOverrider `json:"plaintext,omitempty"`

	// ImageOverrider represents the rules dedicated to handling image overrides.
	// +optional
	ImageOverrider []ImageOverrider `json:"imageOverrider,omitempty"`

	// CommandOverrider represents the rules dedicated to handling container command
	// +optional
	CommandOverrider []CommandArgsOverrider `json:"commandOverrider,omitempty"`

	// ArgsOverrider represents the rules dedicated to handling container args
	// +optional
	ArgsOverrider []CommandArgsOverrider `json:"argsOverrider,omitempty"`

	// LabelsOverrider represents the rules dedicated to handling workload labels
	// +optional
	LabelsOverrider []LabelAnnotationOverrider `json:"labelsOverrider,omitempty"`

	// AnnotationsOverrider represents the rules dedicated to handling workload annotations
	// +optional
	AnnotationsOverrider []LabelAnnotationOverrider `json:"annotationsOverrider,omitempty"`
}

Overriders offers various alternatives to represent the override rules.

If more than one alternative exists, they will be applied with following order: - ImageOverrider - CommandOverrider - ArgsOverrider - LabelsOverrider - AnnotationsOverrider - Plaintext

func (*Overriders) DeepCopy

func (in *Overriders) DeepCopy() *Overriders

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

func (*Overriders) DeepCopyInto

func (in *Overriders) DeepCopyInto(out *Overriders)

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

type Placement

type Placement struct {
	// ClusterAffinity represents scheduling restrictions to a certain set of clusters.
	// Note:
	//   1. ClusterAffinity can not co-exist with ClusterAffinities.
	//   2. If both ClusterAffinity and ClusterAffinities are not set, any cluster
	//      can be scheduling candidates.
	// +optional
	ClusterAffinity *ClusterAffinity `json:"clusterAffinity,omitempty"`

	// ClusterAffinities represents scheduling restrictions to multiple cluster
	// groups that indicated by ClusterAffinityTerm.
	//
	// The scheduler will evaluate these groups one by one in the order they
	// appear in the spec, the group that does not satisfy scheduling restrictions
	// will be ignored which means all clusters in this group will not be selected
	// unless it also belongs to the next group(a cluster could belong to multiple
	// groups).
	//
	// If none of the groups satisfy the scheduling restrictions, then scheduling
	// fails, which means no cluster will be selected.
	//
	// Note:
	//   1. ClusterAffinities can not co-exist with ClusterAffinity.
	//   2. If both ClusterAffinity and ClusterAffinities are not set, any cluster
	//      can be scheduling candidates.
	//
	// Potential use case 1:
	// The private clusters in the local data center could be the main group, and
	// the managed clusters provided by cluster providers could be the secondary
	// group. So that the Karmada scheduler would prefer to schedule workloads
	// to the main group and the second group will only be considered in case of
	// the main group does not satisfy restrictions(like, lack of resources).
	//
	// Potential use case 2:
	// For the disaster recovery scenario, the clusters could be organized to
	// primary and backup groups, the workloads would be scheduled to primary
	// clusters firstly, and when primary cluster fails(like data center power off),
	// Karmada scheduler could migrate workloads to the backup clusters.
	//
	// +optional
	ClusterAffinities []ClusterAffinityTerm `json:"clusterAffinities,omitempty"`

	// ClusterTolerations represents the tolerations.
	// +optional
	ClusterTolerations []corev1.Toleration `json:"clusterTolerations,omitempty"`

	// SpreadConstraints represents a list of the scheduling constraints.
	// +optional
	SpreadConstraints []SpreadConstraint `json:"spreadConstraints,omitempty"`

	// ReplicaScheduling represents the scheduling policy on dealing with the number of replicas
	// when propagating resources that have replicas in spec (e.g. deployments, statefulsets) to member clusters.
	// +optional
	ReplicaScheduling *ReplicaSchedulingStrategy `json:"replicaScheduling,omitempty"`
}

Placement represents the rule for select clusters.

func (*Placement) DeepCopy

func (in *Placement) DeepCopy() *Placement

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

func (*Placement) DeepCopyInto

func (in *Placement) DeepCopyInto(out *Placement)

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

func (*Placement) ReplicaSchedulingType added in v1.6.0

func (p *Placement) ReplicaSchedulingType() ReplicaSchedulingType

ReplicaSchedulingType returns the replica assignment strategy which is "Duplicated" or "Divided". Returns "Duplicated" if the replica strategy is nil.

type PlaintextOverrider

type PlaintextOverrider struct {
	// Path indicates the path of target field
	Path string `json:"path"`
	// Operator indicates the operation on target field.
	// Available operators are: add, replace and remove.
	// +kubebuilder:validation:Enum=add;remove;replace
	Operator OverriderOperator `json:"operator"`
	// Value to be applied to target field.
	// Must be empty when operator is Remove.
	// +optional
	Value apiextensionsv1.JSON `json:"value,omitempty"`
}

PlaintextOverrider is a simple overrider that overrides target fields according to path, operator and value.

func (*PlaintextOverrider) DeepCopy

func (in *PlaintextOverrider) DeepCopy() *PlaintextOverrider

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

func (*PlaintextOverrider) DeepCopyInto

func (in *PlaintextOverrider) DeepCopyInto(out *PlaintextOverrider)

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

type PreemptionBehavior added in v1.7.0

type PreemptionBehavior string

PreemptionBehavior describes whether and how to preempt resources that are claimed by lower-priority PropagationPolicy(ClusterPropagationPolicy). +enum

const (
	// PreemptAlways means that preemption is allowed.
	//
	// If it is applied to a PropagationPolicy, it can preempt any resource as
	// per Priority, regardless of whether it has been claimed by a PropagationPolicy
	// or a ClusterPropagationPolicy, as long as it can match the rules defined
	// in ResourceSelector. In addition, if a resource has already been claimed
	// by a ClusterPropagationPolicy, the PropagationPolicy can still preempt it
	// without considering Priority.
	//
	// If it is applied to a ClusterPropagationPolicy, it can only preempt from
	// ClusterPropagationPolicy, and from PropagationPolicy is not allowed.
	PreemptAlways PreemptionBehavior = "Always"

	// PreemptNever means that a PropagationPolicy(ClusterPropagationPolicy) never
	// preempts resources.
	PreemptNever PreemptionBehavior = "Never"
)

type PropagationPolicy

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

	// Spec represents the desired behavior of PropagationPolicy.
	// +required
	Spec PropagationSpec `json:"spec"`
}

PropagationPolicy represents the policy that propagates a group of resources to one or more clusters.

func (*PropagationPolicy) DeepCopy

func (in *PropagationPolicy) DeepCopy() *PropagationPolicy

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

func (*PropagationPolicy) DeepCopyInto

func (in *PropagationPolicy) DeepCopyInto(out *PropagationPolicy)

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

func (*PropagationPolicy) DeepCopyObject

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

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

func (*PropagationPolicy) ExplicitPriority added in v1.4.0

func (p *PropagationPolicy) ExplicitPriority() int32

ExplicitPriority returns the explicit priority of a PropagationPolicy.

type PropagationPolicyList

type PropagationPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PropagationPolicy `json:"items"`
}

PropagationPolicyList contains a list of PropagationPolicy.

func (*PropagationPolicyList) DeepCopy

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

func (*PropagationPolicyList) DeepCopyInto

func (in *PropagationPolicyList) DeepCopyInto(out *PropagationPolicyList)

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

func (*PropagationPolicyList) DeepCopyObject

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

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

type PropagationSpec

type PropagationSpec struct {
	// ResourceSelectors used to select resources.
	// Nil or empty selector is not allowed and doesn't mean match all kinds
	// of resources for security concerns that sensitive resources(like Secret)
	// might be accidentally propagated.
	// +required
	// +kubebuilder:validation:MinItems=1
	ResourceSelectors []ResourceSelector `json:"resourceSelectors"`

	// Association tells if relevant resources should be selected automatically.
	// e.g. a ConfigMap referred by a Deployment.
	// default false.
	// Deprecated: in favor of PropagateDeps.
	// +optional
	Association bool `json:"association,omitempty"`

	// PropagateDeps tells if relevant resources should be propagated automatically.
	// Take 'Deployment' which referencing 'ConfigMap' and 'Secret' as an example, when 'propagateDeps' is 'true',
	// the referencing resources could be omitted(for saving config effort) from 'resourceSelectors' as they will be
	// propagated along with the Deployment. In addition to the propagating process, the referencing resources will be
	// migrated along with the Deployment in the fail-over scenario.
	//
	// Defaults to false.
	// +optional
	PropagateDeps bool `json:"propagateDeps,omitempty"`

	// Placement represents the rule for select clusters to propagate resources.
	// +optional
	Placement Placement `json:"placement,omitempty"`

	// Priority indicates the importance of a policy(PropagationPolicy or ClusterPropagationPolicy).
	// A policy will be applied for the matched resource templates if there is
	// no other policies with higher priority at the point of the resource
	// template be processed.
	// Once a resource template has been claimed by a policy, by default it will
	// not be preempted by following policies even with a higher priority.
	// See Preemption for more details.
	//
	// In case of two policies have the same priority, the one with a more precise
	// matching rules in ResourceSelectors wins:
	// - matching by name(resourceSelector.name) has higher priority than
	//   by selector(resourceSelector.labelSelector)
	// - matching by selector(resourceSelector.labelSelector) has higher priority
	//   than by APIVersion(resourceSelector.apiVersion) and Kind(resourceSelector.kind).
	// If there is still no winner at this point, the one with the lower alphabetic
	// order wins, e.g. policy 'bar' has higher priority than 'foo'.
	//
	// The higher the value, the higher the priority. Defaults to zero.
	// +optional
	// +kubebuilder:default=0
	Priority *int32 `json:"priority,omitempty"`

	// Preemption declares the behaviors for preempting.
	// Valid options are "Always" and "Never".
	//
	// +kubebuilder:default="Never"
	// +kubebuilder:validation:Enum=Always;Never
	// +optional
	Preemption PreemptionBehavior `json:"preemption,omitempty"`

	// DependentOverrides represents the list of overrides(OverridePolicy)
	// which must present before the current PropagationPolicy takes effect.
	//
	// It used to explicitly specify overrides which current PropagationPolicy rely on.
	// A typical scenario is the users create OverridePolicy(ies) and resources at the same time,
	// they want to ensure the new-created policies would be adopted.
	//
	// Note: For the overrides, OverridePolicy(ies) in current namespace and ClusterOverridePolicy(ies),
	// which not present in this list will still be applied if they matches the resources.
	// +optional
	DependentOverrides []string `json:"dependentOverrides,omitempty"`

	// SchedulerName represents which scheduler to proceed the scheduling.
	// If specified, the policy will be dispatched by specified scheduler.
	// If not specified, the policy will be dispatched by default scheduler.
	// +kubebuilder:default="default-scheduler"
	// +optional
	SchedulerName string `json:"schedulerName,omitempty"`

	// Failover indicates how Karmada migrates applications in case of failures.
	// If this value is nil, failover is disabled.
	// +optional
	Failover *FailoverBehavior `json:"failover,omitempty"`

	// ConflictResolution declares how potential conflict should be handled when
	// a resource that is being propagated already exists in the target cluster.
	//
	// It defaults to "Abort" which means stop propagating to avoid unexpected
	// overwrites. The "Overwrite" might be useful when migrating legacy cluster
	// resources to Karmada, in which case conflict is predictable and can be
	// instructed to Karmada take over the resource by overwriting.
	//
	// +kubebuilder:default="Abort"
	// +kubebuilder:validation:Enum=Abort;Overwrite
	// +optional
	ConflictResolution ConflictResolution `json:"conflictResolution,omitempty"`

	// ActivationPreference indicates how the referencing resource template will
	// be propagated, in case of policy changes.
	//
	// If empty, the resource template will respond to policy changes
	// immediately, in other words, any policy changes will drive the resource
	// template to be propagated immediately as per the current propagation rules.
	//
	// If the value is 'Lazy' means the policy changes will not take effect for now
	// but defer to the resource template changes, in other words, the resource
	// template will not be propagated as per the current propagation rules until
	// there is an update on it.
	// This is an experimental feature that might help in a scenario where a policy
	// manages huge amount of resource templates, changes to a policy typically
	// affect numerous applications simultaneously. A minor misconfiguration
	// could lead to widespread failures. With this feature, the change can be
	// gradually rolled out through iterative modifications of resource templates.
	//
	// +kubebuilder:validation:Enum=Lazy
	// +optional
	ActivationPreference ActivationPreference `json:"activationPreference,omitempty"`
}

PropagationSpec represents the desired behavior of PropagationPolicy.

func (*PropagationSpec) DeepCopy

func (in *PropagationSpec) DeepCopy() *PropagationSpec

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

func (*PropagationSpec) DeepCopyInto

func (in *PropagationSpec) DeepCopyInto(out *PropagationSpec)

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

func (*PropagationSpec) ExplicitPriority added in v1.4.0

func (p *PropagationSpec) ExplicitPriority() int32

ExplicitPriority returns the explicit priority declared by '.spec.Priority'.

type PurgeMode added in v1.6.0

type PurgeMode string

PurgeMode represents that how to deal with the legacy applications on the cluster from which the application is migrated.

const (
	// Immediately represents that Karmada will immediately evict the legacy
	// application.
	Immediately PurgeMode = "Immediately"
	// Graciously represents that Karmada will wait for the application to
	// come back to healthy on the new cluster or after a timeout is reached
	// before evicting the application.
	Graciously PurgeMode = "Graciously"
	// Never represents that Karmada will not evict the application and
	// users manually confirms how to clean up redundant copies.
	Never PurgeMode = "Never"
)

type ReplicaDivisionPreference added in v0.7.0

type ReplicaDivisionPreference string

ReplicaDivisionPreference describes options of how replicas can be scheduled.

const (
	// ReplicaDivisionPreferenceAggregated divides replicas into clusters as few as possible,
	// while respecting clusters' resource availabilities during the division.
	ReplicaDivisionPreferenceAggregated ReplicaDivisionPreference = "Aggregated"
	// ReplicaDivisionPreferenceWeighted divides replicas by weight according to WeightPreference.
	ReplicaDivisionPreferenceWeighted ReplicaDivisionPreference = "Weighted"
)

type ReplicaSchedulingStrategy added in v0.7.0

type ReplicaSchedulingStrategy struct {
	// ReplicaSchedulingType determines how the replicas is scheduled when karmada propagating
	// a resource. Valid options are Duplicated and Divided.
	// "Duplicated" duplicates the same replicas to each candidate member cluster from resource.
	// "Divided" divides replicas into parts according to number of valid candidate member
	// clusters, and exact replicas for each cluster are determined by ReplicaDivisionPreference.
	// +kubebuilder:validation:Enum=Duplicated;Divided
	// +kubebuilder:default=Divided
	// +optional
	ReplicaSchedulingType ReplicaSchedulingType `json:"replicaSchedulingType,omitempty"`

	// ReplicaDivisionPreference determines how the replicas is divided
	// when ReplicaSchedulingType is "Divided". Valid options are Aggregated and Weighted.
	// "Aggregated" divides replicas into clusters as few as possible,
	// while respecting clusters' resource availabilities during the division.
	// "Weighted" divides replicas by weight according to WeightPreference.
	// +kubebuilder:validation:Enum=Aggregated;Weighted
	// +optional
	ReplicaDivisionPreference ReplicaDivisionPreference `json:"replicaDivisionPreference,omitempty"`

	// WeightPreference describes weight for each cluster or for each group of cluster
	// If ReplicaDivisionPreference is set to "Weighted", and WeightPreference is not set, scheduler will weight all clusters the same.
	// +optional
	WeightPreference *ClusterPreferences `json:"weightPreference,omitempty"`
}

ReplicaSchedulingStrategy represents the assignment strategy of replicas.

func (*ReplicaSchedulingStrategy) DeepCopy added in v0.7.0

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

func (*ReplicaSchedulingStrategy) DeepCopyInto added in v0.7.0

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

type ReplicaSchedulingType added in v0.7.0

type ReplicaSchedulingType string

ReplicaSchedulingType describes scheduling methods for the "replicas" in a resource.

const (
	// ReplicaSchedulingTypeDuplicated means when propagating a resource,
	// each candidate member cluster will directly apply the original replicas.
	ReplicaSchedulingTypeDuplicated ReplicaSchedulingType = "Duplicated"
	// ReplicaSchedulingTypeDivided means when propagating a resource,
	// each candidate member cluster will get only a part of original replicas.
	ReplicaSchedulingTypeDivided ReplicaSchedulingType = "Divided"
)

type ResourceSelector

type ResourceSelector struct {
	// APIVersion represents the API version of the target resources.
	// +required
	APIVersion string `json:"apiVersion"`

	// Kind represents the Kind of the target resources.
	// +required
	Kind string `json:"kind"`

	// Namespace of the target resource.
	// Default is empty, which means inherit from the parent object scope.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Name of the target resource.
	// Default is empty, which means selecting all resources.
	// +optional
	Name string `json:"name,omitempty"`

	// A label query over a set of resources.
	// If name is not empty, labelSelector will be ignored.
	// +optional
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
}

ResourceSelector the resources will be selected.

func (*ResourceSelector) DeepCopy

func (in *ResourceSelector) DeepCopy() *ResourceSelector

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

func (*ResourceSelector) DeepCopyInto

func (in *ResourceSelector) DeepCopyInto(out *ResourceSelector)

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

type RuleWithCluster added in v1.0.0

type RuleWithCluster struct {
	// TargetCluster defines restrictions on this override policy
	// that only applies to resources propagated to the matching clusters.
	// nil means matching all clusters.
	// +optional
	TargetCluster *ClusterAffinity `json:"targetCluster,omitempty"`

	// Overriders represents the override rules that would apply on resources
	// +required
	Overriders Overriders `json:"overriders"`
}

RuleWithCluster defines the override rules on clusters.

func (*RuleWithCluster) DeepCopy added in v1.0.0

func (in *RuleWithCluster) DeepCopy() *RuleWithCluster

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

func (*RuleWithCluster) DeepCopyInto added in v1.0.0

func (in *RuleWithCluster) DeepCopyInto(out *RuleWithCluster)

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

type SpreadConstraint

type SpreadConstraint struct {
	// SpreadByField represents the fields on Karmada cluster API used for
	// dynamically grouping member clusters into different groups.
	// Resources will be spread among different cluster groups.
	// Available fields for spreading are: cluster, region, zone, and provider.
	// SpreadByField should not co-exist with SpreadByLabel.
	// If both SpreadByField and SpreadByLabel are empty, SpreadByField will be set to "cluster" by system.
	// +kubebuilder:validation:Enum=cluster;region;zone;provider
	// +optional
	SpreadByField SpreadFieldValue `json:"spreadByField,omitempty"`

	// SpreadByLabel represents the label key used for
	// grouping member clusters into different groups.
	// Resources will be spread among different cluster groups.
	// SpreadByLabel should not co-exist with SpreadByField.
	// +optional
	SpreadByLabel string `json:"spreadByLabel,omitempty"`

	// MaxGroups restricts the maximum number of cluster groups to be selected.
	// +optional
	MaxGroups int `json:"maxGroups,omitempty"`

	// MinGroups restricts the minimum number of cluster groups to be selected.
	// Defaults to 1.
	// +optional
	MinGroups int `json:"minGroups,omitempty"`
}

SpreadConstraint represents the spread constraints on resources.

func (*SpreadConstraint) DeepCopy

func (in *SpreadConstraint) DeepCopy() *SpreadConstraint

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

func (*SpreadConstraint) DeepCopyInto

func (in *SpreadConstraint) DeepCopyInto(out *SpreadConstraint)

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

type SpreadFieldValue

type SpreadFieldValue string

SpreadFieldValue is the type to define valid values for SpreadConstraint.SpreadByField

const (
	SpreadByFieldCluster  SpreadFieldValue = "cluster"
	SpreadByFieldRegion   SpreadFieldValue = "region"
	SpreadByFieldZone     SpreadFieldValue = "zone"
	SpreadByFieldProvider SpreadFieldValue = "provider"
)

Available fields for spreading are: cluster, region, zone, and provider.

type StaticClusterAssignment added in v1.1.0

type StaticClusterAssignment struct {
	// ClusterName is the name of the cluster the limits enforce to.
	// +required
	ClusterName string `json:"clusterName"`

	// Hard is the set of desired hard limits for each named resource.
	// +required
	Hard corev1.ResourceList `json:"hard"`
}

StaticClusterAssignment represents the set of desired hard limits for a specific cluster.

func (*StaticClusterAssignment) DeepCopy added in v1.1.0

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

func (*StaticClusterAssignment) DeepCopyInto added in v1.1.0

func (in *StaticClusterAssignment) DeepCopyInto(out *StaticClusterAssignment)

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

type StaticClusterWeight added in v0.5.0

type StaticClusterWeight struct {
	// TargetCluster describes the filter to select clusters.
	// +required
	TargetCluster ClusterAffinity `json:"targetCluster"`

	// Weight expressing the preference to the cluster(s) specified by 'TargetCluster'.
	// +kubebuilder:validation:Minimum=1
	// +required
	Weight int64 `json:"weight"`
}

StaticClusterWeight defines the static cluster weight.

func (*StaticClusterWeight) DeepCopy added in v0.5.0

func (in *StaticClusterWeight) DeepCopy() *StaticClusterWeight

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

func (*StaticClusterWeight) DeepCopyInto added in v0.5.0

func (in *StaticClusterWeight) DeepCopyInto(out *StaticClusterWeight)

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