Documentation ¶
Index ¶
- Constants
- Variables
- func DiscoverDefaultStorageClassName(ctx context.Context, kubeClient client.Client) (string, error)
- func HasPreferredNodeAffinity(p *v1.Pod) bool
- func ResetDefaultStorageClass()
- type CompatabilityOptions
- type HostPort
- type HostPortUsage
- func (u *HostPortUsage) Add(usedBy *v1.Pod, ports []HostPort)
- func (u *HostPortUsage) Conflicts(usedBy *v1.Pod, ports []HostPort) error
- func (in *HostPortUsage) DeepCopy() *HostPortUsage
- func (in *HostPortUsage) DeepCopyInto(out *HostPortUsage)
- func (u *HostPortUsage) DeletePod(key types.NamespacedName)
- type Requirement
- func (r *Requirement) Any() string
- func (r *Requirement) Has(value string) bool
- func (r *Requirement) Insert(items ...string)
- func (r *Requirement) Intersection(requirement *Requirement) *Requirement
- func (r *Requirement) Len() int
- func (r *Requirement) NodeSelectorRequirement() v1.NodeSelectorRequirement
- func (r *Requirement) Operator() v1.NodeSelectorOperator
- func (r *Requirement) String() string
- func (r *Requirement) Values() []string
- type Requirements
- func NewLabelRequirements(labels map[string]string) Requirements
- func NewNodeSelectorRequirements(requirements ...v1.NodeSelectorRequirement) Requirements
- func NewPodRequirements(pod *v1.Pod) Requirements
- func NewRequirements(requirements ...*Requirement) Requirements
- func NewStrictPodRequirements(pod *v1.Pod) Requirements
- func (r Requirements) Add(requirements ...*Requirement)
- func (r Requirements) Compatible(requirements Requirements, options ...functional.Option[CompatabilityOptions]) (errs error)
- func (r Requirements) Get(key string) *Requirement
- func (r Requirements) Has(key string) bool
- func (r Requirements) Intersects(requirements Requirements) (errs error)
- func (r Requirements) Keys() sets.Set[string]
- func (r Requirements) Labels() map[string]string
- func (r Requirements) NodeSelectorRequirements() []v1.NodeSelectorRequirement
- func (r Requirements) String() string
- func (r Requirements) Values() []*Requirement
- type Taints
- type VolumeUsage
- func (v *VolumeUsage) Add(pod *v1.Pod, volumes Volumes)
- func (v *VolumeUsage) AddLimit(storageDriver string, value int)
- func (in *VolumeUsage) DeepCopy() *VolumeUsage
- func (in *VolumeUsage) DeepCopyInto(out *VolumeUsage)
- func (v *VolumeUsage) DeletePod(key types.NamespacedName)
- func (v *VolumeUsage) ExceedsLimits(vols Volumes) error
- type Volumes
Constants ¶
const IsDefaultStorageClassAnnotation = "storageclass.kubernetes.io/is-default-class"
Variables ¶
var AllowUndefinedWellKnownLabelsV1Alpha5 = func(options CompatabilityOptions) CompatabilityOptions { options.AllowUndefined = v1alpha5.WellKnownLabels return options }
var AllowUndefinedWellKnownLabelsV1Beta1 = func(options CompatabilityOptions) CompatabilityOptions { options.AllowUndefined = v1beta1.WellKnownLabels return options }
var KnownEphemeralTaints = []v1.Taint{ {Key: v1.TaintNodeNotReady, Effect: v1.TaintEffectNoSchedule}, {Key: v1.TaintNodeUnreachable, Effect: v1.TaintEffectNoSchedule}, {Key: cloudproviderapi.TaintExternalCloudProvider, Effect: v1.TaintEffectNoSchedule, Value: "true"}, }
Functions ¶
func DiscoverDefaultStorageClassName ¶ added in v0.30.0
func HasPreferredNodeAffinity ¶ added in v0.30.0
HasPreferredNodeAffinity returns true if the pod has a preferred node affinity term
func ResetDefaultStorageClass ¶ added in v0.30.0
func ResetDefaultStorageClass()
ResetDefaultStorageClass is intended to be called from unit tests to reset the default storage class
Types ¶
type CompatabilityOptions ¶ added in v0.31.0
type HostPort ¶ added in v0.30.0
+k8s:deepcopy-gen=true
func GetHostPorts ¶ added in v0.30.0
func (*HostPort) DeepCopy ¶ added in v0.30.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPort.
func (*HostPort) DeepCopyInto ¶ added in v0.30.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HostPortUsage ¶
type HostPortUsage struct {
// contains filtered or unexported fields
}
HostPortUsage tracks HostPort usage within a node. On a node, each <hostIP, hostPort, protocol> used by pods bound to the node must be unique. We need to track this to keep an accurate concept of what pods can potentially schedule together. +k8s:deepcopy-gen=true
func NewHostPortUsage ¶
func NewHostPortUsage() *HostPortUsage
func (*HostPortUsage) Add ¶
func (u *HostPortUsage) Add(usedBy *v1.Pod, ports []HostPort)
Add adds a port to the HostPortUsage
func (*HostPortUsage) Conflicts ¶ added in v0.30.0
func (u *HostPortUsage) Conflicts(usedBy *v1.Pod, ports []HostPort) error
func (*HostPortUsage) DeepCopy ¶
func (in *HostPortUsage) DeepCopy() *HostPortUsage
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPortUsage.
func (*HostPortUsage) DeepCopyInto ¶
func (in *HostPortUsage) DeepCopyInto(out *HostPortUsage)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*HostPortUsage) DeletePod ¶
func (u *HostPortUsage) DeletePod(key types.NamespacedName)
DeletePod deletes all host port usage from the HostPortUsage that were created by the pod with the given name.
type Requirement ¶
type Requirement struct { Key string // contains filtered or unexported fields }
Requirement is an efficient represenatation of v1.NodeSelectorRequirement
func NewRequirement ¶
func NewRequirement(key string, operator v1.NodeSelectorOperator, values ...string) *Requirement
func (*Requirement) Any ¶
func (r *Requirement) Any() string
func (*Requirement) Has ¶
func (r *Requirement) Has(value string) bool
Has returns true if the requirement allows the value
func (*Requirement) Insert ¶
func (r *Requirement) Insert(items ...string)
func (*Requirement) Intersection ¶
func (r *Requirement) Intersection(requirement *Requirement) *Requirement
Intersection constraints the Requirement from the incoming requirements nolint:gocyclo
func (*Requirement) Len ¶
func (r *Requirement) Len() int
func (*Requirement) NodeSelectorRequirement ¶
func (r *Requirement) NodeSelectorRequirement() v1.NodeSelectorRequirement
func (*Requirement) Operator ¶
func (r *Requirement) Operator() v1.NodeSelectorOperator
func (*Requirement) String ¶
func (r *Requirement) String() string
func (*Requirement) Values ¶
func (r *Requirement) Values() []string
type Requirements ¶
type Requirements map[string]*Requirement
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 and treats any preferred requirements as required.
func NewRequirements ¶
func NewRequirements(requirements ...*Requirement) Requirements
func NewStrictPodRequirements ¶ added in v0.30.0
func NewStrictPodRequirements(pod *v1.Pod) Requirements
NewStrictPodRequirements constructs requirements from a pod and only includes true requirements (not preferences).
func (Requirements) Add ¶
func (r Requirements) Add(requirements ...*Requirement)
Add requirements to provided requirements. Mutates existing requirements
func (Requirements) Compatible ¶
func (r Requirements) Compatible(requirements Requirements, options ...functional.Option[CompatabilityOptions]) (errs error)
Compatible ensures the provided requirements can loosely be met.
func (Requirements) Get ¶
func (r Requirements) Get(key string) *Requirement
func (Requirements) Has ¶
func (r Requirements) Has(key string) bool
func (Requirements) Intersects ¶
func (r Requirements) Intersects(requirements Requirements) (errs error)
Intersects returns errors if the requirements don't have overlapping values, undefined keys are allowed
func (Requirements) Keys ¶
func (r Requirements) Keys() sets.Set[string]
Keys returns unique set of the label keys from the requirements
func (Requirements) Labels ¶
func (r Requirements) Labels() map[string]string
func (Requirements) NodeSelectorRequirements ¶
func (r Requirements) NodeSelectorRequirements() []v1.NodeSelectorRequirement
func (Requirements) String ¶
func (r Requirements) String() string
func (Requirements) Values ¶
func (r Requirements) Values() []*Requirement
type Taints ¶
Taints is a decorated alias type for []v1.Taint
type VolumeUsage ¶ added in v0.22.0
type VolumeUsage struct {
// contains filtered or unexported fields
}
VolumeUsage tracks volume limits on a per node basis. The number of volumes that can be mounted varies by instance type. We need to be aware and track the mounted volume usage to inform our awareness of which pods can schedule to which nodes. +k8s:deepcopy-gen=true
func NewVolumeUsage ¶ added in v0.27.1
func NewVolumeUsage() *VolumeUsage
func (*VolumeUsage) AddLimit ¶ added in v0.30.0
func (v *VolumeUsage) AddLimit(storageDriver string, value int)
func (*VolumeUsage) DeepCopy ¶ added in v0.22.0
func (in *VolumeUsage) DeepCopy() *VolumeUsage
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeUsage.
func (*VolumeUsage) DeepCopyInto ¶ added in v0.22.0
func (in *VolumeUsage) DeepCopyInto(out *VolumeUsage)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*VolumeUsage) DeletePod ¶ added in v0.22.0
func (v *VolumeUsage) DeletePod(key types.NamespacedName)
func (*VolumeUsage) ExceedsLimits ¶ added in v0.30.0
func (v *VolumeUsage) ExceedsLimits(vols Volumes) error
type Volumes ¶ added in v0.30.0
+k8s:deepcopy-gen=true
func GetVolumes ¶ added in v0.30.0
func (Volumes) DeepCopy ¶ added in v0.30.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Volumes.
func (Volumes) DeepCopyInto ¶ added in v0.30.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.