Documentation ¶
Index ¶
- Constants
- func NewCCSimulatorExecutor(conf *options.ClusterCompressionConfig) (pkg.Simulator, error)
- type ClusterCompressionReview
- type ClusterCompressionReviewReviewStatus
- type ClusterCompressionReviewScheduleStopReason
- type FilterFunc
- type FilterStatus
- type NodeFilter
- type Options
- func (o *Options) BuildFilterFunc() FilterFunc
- func (o *Options) WithExcludeNodes(nodes map[string]bool) *Options
- func (o *Options) WithExcludeNotReadyNodes(excludeNotReadyNode bool) *Options
- func (o *Options) WithExcludeTaintNodes(excludeTaintNode bool) *Options
- func (o *Options) WithFilter(filter FilterFunc) *Options
- func (o *Options) WithIgnoreCloneSet(ignoreCloneSet bool) *Options
- func (o *Options) WithIgnoreMirrorPod(ignoreMirrorPod bool) *Options
- func (o *Options) WithIgnoreStaticPod(ignoreStaticPod bool) *Options
- func (o *Options) WithIgnoreVolumePod(ignoreVolumePod bool) *Options
- func (o *Options) WithPodsByNodeFunc(podsByNodeFunc PodsByNodeFunc) *Options
- type PodsByNodeFunc
- type Status
Constants ¶
View Source
const ( NodeScaledDownFailedLabel = "kc.k-cloud-labs.io/node-scale-down-failed" NodeScaledDownSuccessLabel = "kc.k-cloud-labs.io/node-scale-down-success" KubernetesMasterNodeLabel = "node-role.kubernetes.io/master" NodeScaleDownDisableLabel = "kc.k-cloud-labs.io/scale-down-disabled" )
View Source
const ( ErrReasonFailedScaleDown = "node(s) can't be scale down because of insufficient resource in other nodes" ErrReasonSuccessScaleDown = "node(s) has been successfully scale down" ErrReasonScaleDownDisabled = "node(s) have label with scale down disabled" ErrReasonMasterNode = "master node(s)" ErrReasonTaintNode = "node(s) have taint" ErrReasonExcludeNode = "exclude node(s)" ErrReasonNotReadyNode = "not ready node(s)" ErrReasonStaticPod = "node(s) have static pod" ErrReasonMirrorPod = "node(s) have mirror pod" ErrReasonCloneset = "node(s) have inplace update pod" ErrReasonVolumePod = "node(s) have pod used hostpath" ErrReasonUnknown = "node(s) have unknown error" )
View Source
const FailedSelectNode = "FailedSelectNode: could not find a node that satisfies the condition"
Variables ¶
This section is empty.
Functions ¶
func NewCCSimulatorExecutor ¶
func NewCCSimulatorExecutor(conf *options.ClusterCompressionConfig) (pkg.Simulator, error)
NewCCSimulatorExecutor create a ce simulator which is completely independent of apiserver so no need for kubeconfig nor for apiserver url
Types ¶
type ClusterCompressionReview ¶
type ClusterCompressionReview struct { metav1.TypeMeta Status ClusterCompressionReviewReviewStatus `json:"status"` }
type ClusterCompressionReviewReviewStatus ¶
type ClusterCompressionReviewReviewStatus struct { CreationTimestamp time.Time `json:"creationTimestamp"` StopReason *ClusterCompressionReviewScheduleStopReason `json:"stopReason"` ScaleDownNodeNames []string `json:"scaleDownNodeNames"` SelectNodeCount int `json:"SelectNodeCount"` SchedulerCount int `json:"schedulerCount"` FailedSchedulerCount int `json:"failedSchedulerCount"` }
type FilterFunc ¶
type FilterFunc func(*corev1.Node) *FilterStatus
FilterFunc is a filter for a node.
type FilterStatus ¶
type NodeFilter ¶
type NodeFilter interface { SelectNode() *Status Done() }
func NewNodeFilter ¶
func NewNodeFilter(client clientset.Interface, getPodsByNode PodsByNodeFunc, excludeNodes []string, filterNodeOptions options.FilterNodeOptions) (NodeFilter, error)
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (*Options) BuildFilterFunc ¶
func (o *Options) BuildFilterFunc() FilterFunc
BuildFilterFunc builds a final FilterFunc based on Options.
func (*Options) WithExcludeNodes ¶
WithExcludeNodes sets excluded node
func (*Options) WithExcludeNotReadyNodes ¶
WithExcludeNotReadyNodes set notReady options
func (*Options) WithExcludeTaintNodes ¶
WithExcludeTaintNodes set taint options
func (*Options) WithFilter ¶
func (o *Options) WithFilter(filter FilterFunc) *Options
WithFilter sets a node filter.
func (*Options) WithIgnoreCloneSet ¶
WithIgnoreCloneSet set ignoreCloneSet options
func (*Options) WithIgnoreMirrorPod ¶
WithIgnoreMirrorPod set ignoreMirrorPod options
func (*Options) WithIgnoreStaticPod ¶
WithIgnoreStaticPod set ignoreStaticPod options
func (*Options) WithIgnoreVolumePod ¶
WithIgnoreVolumePod set ignoreVolumePod options
func (*Options) WithPodsByNodeFunc ¶
func (o *Options) WithPodsByNodeFunc(podsByNodeFunc PodsByNodeFunc) *Options
Click to show internal directories.
Click to hide internal directories.