v1alpha1

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 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 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.
	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.
	FieldSelector *FieldSelector `json:"fieldSelector,omitempty"`

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

	// ExcludedClusters is the list of clusters to be ignored.
	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 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.
	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 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 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.
	ResourceSelectors []ResourceSelector `json:"resourceSelectors,omitempty"`

	// TargetCluster defines restrictions on this override policy
	// that only applies to resources propagated to the matching clusters
	TargetCluster ClusterAffinity `json:"targetCluster,omitempty"`

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

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.
	Plaintext []PlaintextOverrider `json:"plaintext,omitempty"`
}

Overriders represents the override rules that would apply on resources

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.
	ClusterTolerations []corev1.Toleration `json:"clusterTolerations,omitempty"`

	// SpreadConstraints represents a list of the scheduling constraints.
	SpreadConstraints []SpreadConstraint `json:"spreadConstraints,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.
	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.
	// nil represents all resources.
	ResourceSelectors []ResourceSelector `json:"resourceSelectors,omitempty"`

	// 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.
	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.
	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 ResourceSelector

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

	// Kind represents the Kind of the target resources.
	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.

Jump to

Keyboard shortcuts

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