v1alpha1

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 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 +groupName=policy.karmada.io

Index

Constants

View Source
const (
	// 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"
)
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 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.
	// 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 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.

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.
	// +required
	StaticWeightList []StaticClusterWeight `json:"staticWeightList"`
}

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.

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 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 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 or StatefulSet by following rule:
	//   - Pod: spec/containers/<N>/image
	//   - ReplicaSet: spec/template/spec/containers/<N>/image
	//   - Deployment: spec/template/spec/containers/<N>/image
	//   - StatefulSet: spec/template/spec/containers/<N>/image
	// In addition, all images will be processed if the resource object has more than one containers.
	//
	// 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:
	// - k8s.gcr.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 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.

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

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

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

Overriders offers various alternatives to represent the override rules.

If more than one alternatives exist, they will be applied with following order: - ImageOverrider - 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.
	// If not set, any cluster can be scheduling candidate.
	// +optional
	ClusterAffinity *ClusterAffinity `json:"clusterAffinity,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.

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, update 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 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.

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.
	// +required
	ResourceSelectors []ResourceSelector `json:"resourceSelectors"`

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

	// Placement represents the rule for select clusters to propagate resources.
	// +optional
	Placement Placement `json:"placement,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.
	// +optional
	SchedulerName string `json:"schedulerName,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.

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 ReplicaSchedulingPolicy added in v0.5.0

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

	// Spec represents the desired behavior of ReplicaSchedulingPolicy.
	Spec ReplicaSchedulingSpec `json:"spec"`
}

ReplicaSchedulingPolicy represents the policy that propagates total number of replicas for deployment.

func (*ReplicaSchedulingPolicy) DeepCopy added in v0.5.0

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

func (*ReplicaSchedulingPolicy) DeepCopyInto added in v0.5.0

func (in *ReplicaSchedulingPolicy) DeepCopyInto(out *ReplicaSchedulingPolicy)

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

func (*ReplicaSchedulingPolicy) DeepCopyObject added in v0.5.0

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

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

type ReplicaSchedulingPolicyList added in v0.5.0

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

ReplicaSchedulingPolicyList contains a list of ReplicaSchedulingPolicy.

func (*ReplicaSchedulingPolicyList) DeepCopy added in v0.5.0

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

func (*ReplicaSchedulingPolicyList) DeepCopyInto added in v0.5.0

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

func (*ReplicaSchedulingPolicyList) DeepCopyObject added in v0.5.0

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

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

type ReplicaSchedulingSpec added in v0.5.0

type ReplicaSchedulingSpec struct {
	// ResourceSelectors used to select resources.
	// +required
	ResourceSelectors []ResourceSelector `json:"resourceSelectors"`

	// TotalReplicas represents the total number of replicas across member clusters.
	// The replicas(spec.replicas) specified for deployment template will be discarded.
	// +required
	TotalReplicas int32 `json:"totalReplicas"`

	// Preferences describes weight for each cluster or for each group of cluster.
	// +required
	Preferences ClusterPreferences `json:"preferences"`
}

ReplicaSchedulingSpec represents the desired behavior of ReplicaSchedulingPolicy.

func (*ReplicaSchedulingSpec) DeepCopy added in v0.5.0

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

func (*ReplicaSchedulingSpec) DeepCopyInto added in v0.5.0

func (in *ReplicaSchedulingSpec) DeepCopyInto(out *ReplicaSchedulingSpec)

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

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
	// +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 resouce.

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