nodereaper

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeReaperResultMetricName = "governor_node_reaper_result"
)

Variables

This section is empty.

Functions

func Run

func Run(args *Args) error

Run is the main runner function for node-reaper, and will initialize and start the node-reaper

Types

type AgeDrainReapableInstance

type AgeDrainReapableInstance struct {
	NodeName   string
	InstanceID string
	AgeMinutes int
}

AgeDrainReapableInstances holds an age-reapable node

type AgeSorter

type AgeSorter []AgeDrainReapableInstance

AgeSorter sorts age-reapable nodes by their AgeMinutes

func (AgeSorter) Len

func (a AgeSorter) Len() int

func (AgeSorter) Less

func (a AgeSorter) Less(i, j int) bool

func (AgeSorter) Swap

func (a AgeSorter) Swap(i, j int)

type Args

type Args struct {
	K8sConfigPath                string
	ReaperConfigFilePath         string
	KubectlLocalPath             string
	EC2Region                    string
	ReapUnjoinedKey              string
	ReapUnjoinedValue            string
	DryRun                       bool
	SoftReap                     bool
	LocalMode                    bool
	ReapUnknown                  bool
	ReapUnready                  bool
	ReapGhost                    bool
	ReapUnjoined                 bool
	ReapFlappy                   bool
	AsgValidation                bool
	ReapOld                      bool
	FlapCount                    int32
	ReapOldThresholdMinutes      int32
	ReapUnjoinedThresholdMinutes int32
	MaxKill                      int
	ReapThrottle                 int64
	AgeReapThrottle              int64
	ReapAfter                    float64
	ReapTainted                  []string
	ReconsiderUnreapableAfter    float64
	DrainTimeoutSeconds          int64
	IgnoreFailure                bool
	PromPushgateway              string
}

Args is the argument struct for node-reaper

type ReapableInstance

type ReapableInstance struct {
	NodeName           string
	InstanceID         string
	RequiresValidation bool
}

type ReaperAwsAuth

type ReaperAwsAuth struct {
	EC2 ec2iface.EC2API
	ASG autoscalingiface.AutoScalingAPI
}

ReaperAwsAuth is an AWS client-set

type ReaperContext

type ReaperContext struct {
	// clients
	KubernetesClient     kubernetes.Interface
	KubernetesConfigPath string
	// validated arguments
	ReaperConfigFilePath         string
	EC2Region                    string
	KubectlLocalPath             string
	ReapUnjoinedKey              string
	ReapUnjoinedValue            string
	DryRun                       bool
	SoftReap                     bool
	ReapUnknown                  bool
	ReapUnready                  bool
	ReapGhost                    bool
	ReapUnjoined                 bool
	ReapFlappy                   bool
	AsgValidation                bool
	ReapOld                      bool
	ReapThrottle                 int64
	AgeReapThrottle              int64
	ReapOldThresholdMinutes      int32
	ReapUnjoinedThresholdMinutes int32
	FlapCount                    int32
	MaxKill                      int
	TimeToReap                   float64
	ReapTainted                  []v1.Taint
	ReconsiderUnreapableAfter    float64
	DrainTimeoutSeconds          int64
	IgnoreFailure                bool
	// runtime
	UnreadyNodes              []v1.Node
	AllNodes                  []v1.Node
	AllPods                   []v1.Pod
	AllEvents                 []v1.Event
	AllInstances              []*ec2.Instance
	ClusterInstances          []*ec2.Instance
	ClusterInstancesData      map[string]float64
	GhostInstances            map[string]string
	NodeInstanceIDs           map[string]string
	SelfNode                  string
	SelfNamespace             string
	SelfName                  string
	AgeKillOrder              []string
	AgeDrainReapableInstances []AgeDrainReapableInstance
	ReapableInstances         []ReapableInstance
	DrainableInstances        map[string]string
	TerminatedInstances       int
	DrainedInstances          int
	MetricsAPI                common.MetricsAPI
}

ReaperContext holds the context of the node-reaper and target cluster

Jump to

Keyboard shortcuts

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