scheduling

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TaintToToleration

func TaintToToleration(taint v1.Taint) v1.Toleration

TaintToToleration converts a taint to a toleration that tolerates the specified taint.

Types

type NodeTemplate

type NodeTemplate struct {
	Provider             *v1alpha5.Provider
	Labels               map[string]string
	Taints               Taints
	StartupTaints        Taints
	Requirements         Requirements
	KubeletConfiguration *v1alpha5.KubeletConfiguration
}

NodeTemplate encapsulates the fields required to create a node and mirrors the fields in Provisioner. These structs are maintained separately in order for fields like Requirements to be able to be stored more efficiently.

func NewNodeTemplate

func NewNodeTemplate(provisioner *v1alpha5.Provisioner, requirements ...Requirements) *NodeTemplate

func (*NodeTemplate) ToNode

func (n *NodeTemplate) ToNode() *v1.Node

type Requirements

type Requirements map[string]sets.Set

Requirements are an efficient set representation under the hood. Since its underlying types are slices and maps, this type should not be used as a pointer.

func NewLabelRequirements

func NewLabelRequirements(labels map[string]string) Requirements

NewLabelRequirements constructs requirements from labels

func NewNodeSelectorRequirements

func NewNodeSelectorRequirements(requirements ...v1.NodeSelectorRequirement) Requirements

NewRequirements constructs requirements from NodeSelectorRequirements

func NewPodRequirements

func NewPodRequirements(pod *v1.Pod) Requirements

NewPodRequirements constructs requirements from a pod

func NewRequirements

func NewRequirements(requirements ...Requirements) Requirements

func (Requirements) Add

func (r Requirements) Add(requirements ...Requirements)

Add requirements to provided requirements. Mutates existing requirements

func (Requirements) Architectures

func (r Requirements) Architectures() stringsets.String

func (Requirements) CapacityTypes

func (r Requirements) CapacityTypes() stringsets.String

func (Requirements) Compatible

func (r Requirements) Compatible(requirements Requirements) (errs error)

Compatible ensures the provided requirements can be met.

func (Requirements) Get

func (r Requirements) Get(key string) sets.Set

func (Requirements) Has

func (r Requirements) Has(key string) bool

func (Requirements) InstanceTypes

func (r Requirements) InstanceTypes() stringsets.String

func (Requirements) Keys

func (r Requirements) Keys() stringsets.String

Keys returns unique set of the label keys from the requirements

func (Requirements) OperatingSystems

func (r Requirements) OperatingSystems() stringsets.String

func (Requirements) String

func (r Requirements) String() string

func (Requirements) Zones

func (r Requirements) Zones() stringsets.String

type Taints

type Taints []v1.Taint

Taints is a decorated alias type for []v1.Taint

func (Taints) Has

func (ts Taints) Has(taint v1.Taint) bool

Has returns true if taints has a taint for the given key and effect

func (Taints) HasKey

func (ts Taints) HasKey(taintKey string) bool

HasKey returns true if taints has a taint for the given key

func (Taints) Tolerates

func (ts Taints) Tolerates(pod *v1.Pod, additional ...v1.Toleration) (errs error)

Tolerates returns true if the pod tolerates all taints. 'additional' are extra tolerations for things like startup taints or the standard not-ready taint applied to nodes we have launched.

Jump to

Keyboard shortcuts

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