Documentation ¶
Index ¶
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type CalculatedThreshold
- type CheckThrottleStatus
- type ClusterThrottle
- func (thr ClusterThrottle) CheckThrottledFor(pod *corev1.Pod, reservedResourceAmount ResourceAmount, ...) CheckThrottleStatus
- func (in *ClusterThrottle) DeepCopy() *ClusterThrottle
- func (in *ClusterThrottle) DeepCopyInto(out *ClusterThrottle)
- func (in *ClusterThrottle) DeepCopyObject() runtime.Object
- type ClusterThrottleList
- type ClusterThrottleSelector
- func (in *ClusterThrottleSelector) DeepCopy() *ClusterThrottleSelector
- func (in *ClusterThrottleSelector) DeepCopyInto(out *ClusterThrottleSelector)
- func (s ClusterThrottleSelector) MatchesToNamespace(ns *corev1.Namespace) (bool, error)
- func (s ClusterThrottleSelector) MatchesToPod(pod *corev1.Pod, ns *corev1.Namespace) (bool, error)
- type ClusterThrottleSelectorTerm
- func (in *ClusterThrottleSelectorTerm) DeepCopy() *ClusterThrottleSelectorTerm
- func (in *ClusterThrottleSelectorTerm) DeepCopyInto(out *ClusterThrottleSelectorTerm)
- func (t ClusterThrottleSelectorTerm) MatchesToNamespace(ns *corev1.Namespace) (bool, error)
- func (t ClusterThrottleSelectorTerm) MatchesToPod(pod *corev1.Pod, ns *corev1.Namespace) (bool, error)
- type ClusterThrottleSpec
- type IsResourceAmountThrottled
- type IsResourceCountThrottled
- type ResourceAmount
- func (a ResourceAmount) Add(b ResourceAmount) ResourceAmount
- func (in *ResourceAmount) DeepCopy() *ResourceAmount
- func (in *ResourceAmount) DeepCopyInto(out *ResourceAmount)
- func (threshold ResourceAmount) IsThrottled(used ResourceAmount, isThrottledOnEqual bool) IsResourceAmountThrottled
- func (a ResourceAmount) String() string
- func (a ResourceAmount) Sub(b ResourceAmount) ResourceAmount
- type ResourceCounts
- type TemporaryThresholdOverride
- func (o TemporaryThresholdOverride) BeginTime() (time.Time, error)
- func (in *TemporaryThresholdOverride) DeepCopy() *TemporaryThresholdOverride
- func (in *TemporaryThresholdOverride) DeepCopyInto(out *TemporaryThresholdOverride)
- func (o TemporaryThresholdOverride) EndTime() (time.Time, error)
- func (o TemporaryThresholdOverride) IsActive(now time.Time) (bool, error)
- type Throttle
- type ThrottleList
- type ThrottleSelector
- type ThrottleSelectorTerm
- type ThrottleSpec
- type ThrottleSpecBase
- type ThrottleStatus
Constants ¶
This section is empty.
Variables ¶
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 )
var SchemeGroupVersion = schema.GroupVersion{Group: schedule.GroupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
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 ¶
func (in *ClusterThrottleSelector) DeepCopy() *ClusterThrottleSelector
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 ¶
type ClusterThrottleSelectorTerm ¶
type ClusterThrottleSelectorTerm struct { ThrottleSelectorTerm `json:",inline"` NamespaceSelector metav1.LabelSelector `json:"namespaceSelector"` }
func (*ClusterThrottleSelectorTerm) DeepCopy ¶
func (in *ClusterThrottleSelectorTerm) DeepCopy() *ClusterThrottleSelectorTerm
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterThrottleSelectorTerm.
func (*ClusterThrottleSelectorTerm) DeepCopyInto ¶
func (in *ClusterThrottleSelectorTerm) DeepCopyInto(out *ClusterThrottleSelectorTerm)
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 ¶
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 ¶
func (in *IsResourceAmountThrottled) DeepCopy() *IsResourceAmountThrottled
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IsResourceAmountThrottled.
func (*IsResourceAmountThrottled) DeepCopyInto ¶
func (in *IsResourceAmountThrottled) DeepCopyInto(out *IsResourceAmountThrottled)
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 ¶
func (in *IsResourceCountThrottled) DeepCopy() *IsResourceCountThrottled
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 (a ResourceAmount) Add(b ResourceAmount) ResourceAmount
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 ¶
func (a ResourceAmount) Sub(b ResourceAmount) ResourceAmount
type ResourceCounts ¶
type ResourceCounts struct {
Pod int `json:"pod"`
}
func (ResourceCounts) Add ¶
func (a ResourceCounts) Add(b ResourceCounts) ResourceCounts
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 ¶
func (a ResourceCounts) Sub(b ResourceCounts) ResourceCounts
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 ¶
func (in *TemporaryThresholdOverride) DeepCopy() *TemporaryThresholdOverride
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemporaryThresholdOverride.
func (*TemporaryThresholdOverride) DeepCopyInto ¶
func (in *TemporaryThresholdOverride) DeepCopyInto(out *TemporaryThresholdOverride)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Throttle.
func (*Throttle) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Throttle) DeepCopyObject ¶
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 ¶
func (in *ThrottleSelectorTerm) DeepCopy() *ThrottleSelectorTerm
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 ¶
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.