v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

+kubebuilder:object:generate=true +k8s:deepcopy-gen=package,register +groupName=placement-policy.scheduling.x-k8s.io

Index

Constants

View Source
const (
	// EnforcementModeBestEffort means the policy will be enforced as best effort
	EnforcementModeBestEffort EnforcementMode = "BestEffort"
	// EnforcementModeStrict the policy will be forced during scheduling
	EnforcementModeStrict EnforcementMode = "Strict"

	// ActionMust means the pods must be placed on the node
	ActionMust Action = "Must"
	// ActionMustNot means the pods must not be placed on the node
	ActionMustNot Action = "MustNot"

	// PlacementPolicyAnnotationKey is the annotation key for placement policy
	PlacementPolicyAnnotationKey = "placement-policy.x-k8s.io/policy-name"
	// PlacementPolicyPreferenceAnnotationKey is the annotation key for placement policy node preference
	PlacementPolicyPreferenceAnnotationKey = "placement-policy.x-k8s.io/node-preference-matching-labels"
)
View Source
const GroupName = "placement-policy.scheduling.x-k8s.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 Action

type Action string

Action is an enumeration of the actions

type EnforcementMode

type EnforcementMode string

EnforcementMode is an enumeration of the enforcement modes

type PlacementPolicy

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

	Spec   PlacementPolicySpec   `json:"spec,omitempty"`
	Status PlacementPolicyStatus `json:"status,omitempty"`
}

PlacementPolicy is the Schema for the placementpolicies API

func (*PlacementPolicy) DeepCopy

func (in *PlacementPolicy) DeepCopy() *PlacementPolicy

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

func (*PlacementPolicy) DeepCopyInto

func (in *PlacementPolicy) DeepCopyInto(out *PlacementPolicy)

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

func (*PlacementPolicy) DeepCopyObject

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

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

type PlacementPolicyList

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

PlacementPolicyList contains a list of PlacementPolicy

func (*PlacementPolicyList) DeepCopy

func (in *PlacementPolicyList) DeepCopy() *PlacementPolicyList

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

func (*PlacementPolicyList) DeepCopyInto

func (in *PlacementPolicyList) DeepCopyInto(out *PlacementPolicyList)

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

func (*PlacementPolicyList) DeepCopyObject

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

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

type PlacementPolicySpec

type PlacementPolicySpec struct {
	// The policy weight allows the engine to decide which policy to use when
	// pods match multiple policies. If multiple policies matched and all
	// share the same weight then a policy with spec.enforcementMode == Force
	// will be selected. If multiple policies match and +1 policy is marked
	// as “Force” enforcementMode then they will sorted alphabetically /
	// ascending and first one will be used. The scheduler publishes events
	// capturing this conflict when it happens. Weight == 0-100 is reserved
	// for future use.
	Weight int32 `json:"weight,omitempty"`
	// enforcementMode is an enum that specifies how the policy will be
	// enforced during scheduler (e.g. the application of filter vs scorer
	// plugin). Values allowed for this field are:
	// BestEffort (default): the policy will be enforced as best effort
	// (scorer mode).
	// Strict: the policy will be forced during scheduling. The filter
	// approach will be used. Note: that may yield pods unschedulable.
	EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"`
	// podSelector identifies which pods this placement policy will apply on
	PodSelector *metav1.LabelSelector `json:"podSelector,omitempty"`
	// nodeSelector selects the nodes where the placement policy will
	// apply on according to action
	NodeSelector *metav1.LabelSelector `json:"nodeSelector,omitempty"`
	// Policy is the policy placement for target based on action
	Policy *Policy `json:"policy,omitempty"`
}

PlacementPolicySpec defines the desired state of PlacementPolicy

func (*PlacementPolicySpec) DeepCopy

func (in *PlacementPolicySpec) DeepCopy() *PlacementPolicySpec

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

func (*PlacementPolicySpec) DeepCopyInto

func (in *PlacementPolicySpec) DeepCopyInto(out *PlacementPolicySpec)

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

type PlacementPolicyStatus

type PlacementPolicyStatus struct {
}

PlacementPolicyStatus defines the observed state of PlacementPolicy

func (*PlacementPolicyStatus) DeepCopy

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

func (*PlacementPolicyStatus) DeepCopyInto

func (in *PlacementPolicyStatus) DeepCopyInto(out *PlacementPolicyStatus)

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

type Policy

type Policy struct {
	// The action field is policy placement action. It is a string enum
	// that carries the following possible values:
	// Must(default): based on the rule below pods must be placed on
	// nodes selected by node selector
	// MustNot: based on the rule pods must *not* be placed nodes
	// selected by node selector
	Action Action `json:"action,omitempty"`
	// TargetSize is the number of pods that can or cannot be placed on the node.
	// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
	// Absolute number is calculated from percentage by rounding down.
	TargetSize *intstr.IntOrString `json:"targetSize,omitempty"`
}

func (*Policy) DeepCopy

func (in *Policy) DeepCopy() *Policy

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

func (*Policy) DeepCopyInto

func (in *Policy) DeepCopyInto(out *Policy)

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