v1alpha1

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeBuilder initializes a scheme builder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is a global function that registers this API group & version to a scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: schedule.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CalculatedThreshold

type CalculatedThreshold struct {
	// +kubebuilder:validation:Required
	Threshold ResourceAmount `json:"threshold"`
	// +kubebuilder:validation:Required
	CalculatedAt metav1.Time `json:"calculatedAt"`
	Messages     []string    `json:"messages,omitempty"`
}

func (*CalculatedThreshold) DeepCopy

func (in *CalculatedThreshold) DeepCopy() *CalculatedThreshold

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

func (*CalculatedThreshold) DeepCopyInto

func (in *CalculatedThreshold) DeepCopyInto(out *CalculatedThreshold)

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

type CheckThrottleStatus

type CheckThrottleStatus string
var (
	CheckThrottleStatusNotThrottled                CheckThrottleStatus = "not-throttled"
	CheckThrottleStatusActive                      CheckThrottleStatus = "active"
	CheckThrottleStatusInsufficient                CheckThrottleStatus = "insufficient"
	CheckThrottleStatusPodRequestsExceedsThreshold CheckThrottleStatus = "pod-requests-exceeds-threshold"
)

type ClusterThrottle

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

	Spec   ClusterThrottleSpec `json:"spec,omitempty"`
	Status ThrottleStatus      `json:"status,omitempty"`
}

func (ClusterThrottle) CheckThrottledFor

func (thr ClusterThrottle) CheckThrottledFor(pod *corev1.Pod, reservedResourceAmount ResourceAmount, isThrottledOnEqual bool) CheckThrottleStatus

func (*ClusterThrottle) DeepCopy

func (in *ClusterThrottle) DeepCopy() *ClusterThrottle

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

func (*ClusterThrottle) DeepCopyInto

func (in *ClusterThrottle) DeepCopyInto(out *ClusterThrottle)

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

func (*ClusterThrottle) DeepCopyObject

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

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

type ClusterThrottleList

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

func (*ClusterThrottleList) DeepCopy

func (in *ClusterThrottleList) DeepCopy() *ClusterThrottleList

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

func (*ClusterThrottleList) DeepCopyInto

func (in *ClusterThrottleList) DeepCopyInto(out *ClusterThrottleList)

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

func (*ClusterThrottleList) DeepCopyObject

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

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

type ClusterThrottleSelector

type ClusterThrottleSelector struct {
	SelecterTerms []ClusterThrottleSelectorTerm `json:"selectorTerms,omitempty"`
}

func (*ClusterThrottleSelector) DeepCopy

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

func (*ClusterThrottleSelector) DeepCopyInto

func (in *ClusterThrottleSelector) DeepCopyInto(out *ClusterThrottleSelector)

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

func (ClusterThrottleSelector) MatchesToNamespace added in v1.1.0

func (s ClusterThrottleSelector) MatchesToNamespace(ns *corev1.Namespace) (bool, error)

func (ClusterThrottleSelector) MatchesToPod

func (s ClusterThrottleSelector) MatchesToPod(pod *corev1.Pod, ns *corev1.Namespace) (bool, error)

type ClusterThrottleSelectorTerm

type ClusterThrottleSelectorTerm struct {
	ThrottleSelectorTerm `json:",inline"`
	NamespaceSelector    metav1.LabelSelector `json:"namespaceSelector"`
}

func (*ClusterThrottleSelectorTerm) DeepCopy

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

func (*ClusterThrottleSelectorTerm) DeepCopyInto

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

func (ClusterThrottleSelectorTerm) MatchesToNamespace added in v1.1.0

func (t ClusterThrottleSelectorTerm) MatchesToNamespace(ns *corev1.Namespace) (bool, error)

func (ClusterThrottleSelectorTerm) MatchesToPod

func (t ClusterThrottleSelectorTerm) MatchesToPod(pod *corev1.Pod, ns *corev1.Namespace) (bool, error)

type ClusterThrottleSpec

type ClusterThrottleSpec struct {
	ThrottleSpecBase `json:",inline"`
	Selector         ClusterThrottleSelector `json:"selector,omitempty"`
}

func (*ClusterThrottleSpec) DeepCopy

func (in *ClusterThrottleSpec) DeepCopy() *ClusterThrottleSpec

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

func (*ClusterThrottleSpec) DeepCopyInto

func (in *ClusterThrottleSpec) DeepCopyInto(out *ClusterThrottleSpec)

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

type IsResourceAmountThrottled

type IsResourceAmountThrottled struct {
	ResourceCounts IsResourceCountThrottled `json:"resourceCounts"`

	//+nullable
	ResourceRequests map[corev1.ResourceName]bool `json:"resourceRequests,omitempty"`
}

func (*IsResourceAmountThrottled) DeepCopy

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

func (*IsResourceAmountThrottled) DeepCopyInto

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

func (IsResourceAmountThrottled) IsThrottledFor

func (t IsResourceAmountThrottled) IsThrottledFor(pod *corev1.Pod) bool

type IsResourceCountThrottled

type IsResourceCountThrottled struct {
	Pod bool `json:"pod"`
}

func (*IsResourceCountThrottled) DeepCopy

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

func (*IsResourceCountThrottled) DeepCopyInto

func (in *IsResourceCountThrottled) DeepCopyInto(out *IsResourceCountThrottled)

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

type ResourceAmount

type ResourceAmount struct {
	ResourceCounts *ResourceCounts `json:"resourceCounts,omitempty"`

	//+nullable
	ResourceRequests corev1.ResourceList `json:"resourceRequests,omitempty"`
}

func ResourceAmountOfPod

func ResourceAmountOfPod(pod *corev1.Pod) ResourceAmount

func (ResourceAmount) Add

func (*ResourceAmount) DeepCopy

func (in *ResourceAmount) DeepCopy() *ResourceAmount

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

func (*ResourceAmount) DeepCopyInto

func (in *ResourceAmount) DeepCopyInto(out *ResourceAmount)

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

func (ResourceAmount) IsThrottled

func (threshold ResourceAmount) IsThrottled(used ResourceAmount, isThrottledOnEqual bool) IsResourceAmountThrottled

func (ResourceAmount) String

func (a ResourceAmount) String() string

func (ResourceAmount) Sub

type ResourceCounts

type ResourceCounts struct {
	Pod int `json:"pod"`
}

func (ResourceCounts) Add

func (*ResourceCounts) DeepCopy

func (in *ResourceCounts) DeepCopy() *ResourceCounts

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

func (*ResourceCounts) DeepCopyInto

func (in *ResourceCounts) DeepCopyInto(out *ResourceCounts)

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

func (ResourceCounts) Sub

type TemporaryThresholdOverride

type TemporaryThresholdOverride struct {
	Begin string `json:"begin"`
	End   string `json:"end"`
	// +kubebuilder:validation:Required
	Threshold ResourceAmount `json:"threshold"`
}

func (TemporaryThresholdOverride) BeginTime

func (o TemporaryThresholdOverride) BeginTime() (time.Time, error)

func (*TemporaryThresholdOverride) DeepCopy

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

func (*TemporaryThresholdOverride) DeepCopyInto

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

func (TemporaryThresholdOverride) EndTime

func (o TemporaryThresholdOverride) EndTime() (time.Time, error)

func (TemporaryThresholdOverride) IsActive

func (o TemporaryThresholdOverride) IsActive(now time.Time) (bool, error)

type Throttle

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

	Spec   ThrottleSpec   `json:"spec,omitempty"`
	Status ThrottleStatus `json:"status,omitempty"`
}

func (Throttle) CheckThrottledFor

func (thr Throttle) CheckThrottledFor(pod *corev1.Pod, reservedResourceAmount ResourceAmount, isThrottledOnEqual bool) CheckThrottleStatus

func (*Throttle) DeepCopy

func (in *Throttle) DeepCopy() *Throttle

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

func (*Throttle) DeepCopyInto

func (in *Throttle) DeepCopyInto(out *Throttle)

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

func (*Throttle) DeepCopyObject

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

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

type ThrottleList

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

func (*ThrottleList) DeepCopy

func (in *ThrottleList) DeepCopy() *ThrottleList

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

func (*ThrottleList) DeepCopyInto

func (in *ThrottleList) DeepCopyInto(out *ThrottleList)

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

func (*ThrottleList) DeepCopyObject

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

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

type ThrottleSelector

type ThrottleSelector struct {
	SelecterTerms []ThrottleSelectorTerm `json:"selectorTerms,omitempty"`
}

func (*ThrottleSelector) DeepCopy

func (in *ThrottleSelector) DeepCopy() *ThrottleSelector

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

func (*ThrottleSelector) DeepCopyInto

func (in *ThrottleSelector) DeepCopyInto(out *ThrottleSelector)

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

func (ThrottleSelector) MatchesToPod

func (s ThrottleSelector) MatchesToPod(pod *corev1.Pod) (bool, error)

type ThrottleSelectorTerm

type ThrottleSelectorTerm struct {
	PodSelector metav1.LabelSelector `json:"podSelector"`
}

func (*ThrottleSelectorTerm) DeepCopy

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

func (*ThrottleSelectorTerm) DeepCopyInto

func (in *ThrottleSelectorTerm) DeepCopyInto(out *ThrottleSelectorTerm)

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

func (ThrottleSelectorTerm) MatchesToPod

func (t ThrottleSelectorTerm) MatchesToPod(pod *corev1.Pod) (bool, error)

type ThrottleSpec

type ThrottleSpec struct {
	ThrottleSpecBase `json:",inline"`
	Selector         ThrottleSelector `json:"selector,omitempty"`
}

func (*ThrottleSpec) DeepCopy

func (in *ThrottleSpec) DeepCopy() *ThrottleSpec

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

func (*ThrottleSpec) DeepCopyInto

func (in *ThrottleSpec) DeepCopyInto(out *ThrottleSpec)

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

type ThrottleSpecBase

type ThrottleSpecBase struct {
	// +kubebuilder:validation:Required
	ThrottlerName string `json:"throttlerName,omitempty"`
	// +kubebuilder:validation:Required
	Threshold ResourceAmount `json:"threshold,omitempty"`

	TemporaryThresholdOverrides []TemporaryThresholdOverride `json:"temporaryThresholdOverrides,omitempty"`
}

func (ThrottleSpecBase) CalculateThreshold

func (b ThrottleSpecBase) CalculateThreshold(now time.Time) CalculatedThreshold

func (*ThrottleSpecBase) DeepCopy

func (in *ThrottleSpecBase) DeepCopy() *ThrottleSpecBase

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

func (*ThrottleSpecBase) DeepCopyInto

func (in *ThrottleSpecBase) DeepCopyInto(out *ThrottleSpecBase)

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

func (ThrottleSpecBase) NextOverrideHappensIn

func (b ThrottleSpecBase) NextOverrideHappensIn(now time.Time) (*time.Duration, error)

type ThrottleStatus

type ThrottleStatus struct {
	CalculatedThreshold CalculatedThreshold       `json:"calculatedThreshold,omitempty"`
	Throttled           IsResourceAmountThrottled `json:"throttled,omitempty"`
	Used                ResourceAmount            `json:"used,omitempty"`
}

func (*ThrottleStatus) DeepCopy

func (in *ThrottleStatus) DeepCopy() *ThrottleStatus

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

func (*ThrottleStatus) DeepCopyInto

func (in *ThrottleStatus) DeepCopyInto(out *ThrottleStatus)

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