Documentation ¶
Index ¶
- func Combine(l Lists) (Instances, Pods)
- func HasASGData(i *Instance) bool
- func HasEC2Data(i *Instance) bool
- func HasLifecycleMessage(i *Instance) booldeprecated
- func HasNodeData(i *Instance) bool
- func HasSpotData(i *Instance) bool
- func InstancesByEC2State(i1, i2 *Instance) bool
- func InstancesByID(i1, i2 *Instance) bool
- func InstancesByLaunchTime(i1, i2 *Instance) bool
- func InstancesByTriggeredAt(i1, i2 *Instance) bool
- func LifecycleCompleted(i *Instance) bool
- func LifecycleDeleted(i *Instance) bool
- func PendingLifecycleCompletion(i *Instance) booldeprecated
- func PodCanDecrement(p *Pod) bool
- func PodImmuneToEviction(p *Pod) bool
- func PodNotImmuneToEviction(p *Pod) bool
- func PodsByImmuneToEviction(p1, p2 *Pod) bool
- func PodsByNeedsEviction(p1, p2 *Pod) bool
- type Collectors
- type Instance
- func (i *Instance) HasASGData() bool
- func (i *Instance) HasEC2Data() bool
- func (i *Instance) HasEC2State(states ...string) bool
- func (i *Instance) HasLifecycleMessage() booldeprecated
- func (i *Instance) HasNodeData() bool
- func (i *Instance) NodeName() string
- func (i *Instance) PendingLifecycleCompletion() booldeprecated
- func (instance Instance) PodStats() InstancePodStats
- func (i *Instance) WantsShutdown() booldeprecated
- type InstancePodStats
- type InstanceSelector
- type Instances
- type InstancesBy
- type Lists
- type Pod
- func (p *Pod) NeedsEviction() booldeprecated
- type PodSelector
- type Pods
- type PodsBy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Combine ¶
Combine merges all data sources and returns all in one structs for Pods and Instances.
func HasASGData ¶
func HasEC2Data ¶
func HasLifecycleMessage
deprecated
func HasNodeData ¶ added in v2.1.0
func HasSpotData ¶
func InstancesByEC2State ¶
func InstancesByID ¶
InstancesByID defines the order based on the Instance ID.
func InstancesByLaunchTime ¶
InstancesByLaunchTime defines the order based on the instance start time.
func InstancesByTriggeredAt ¶
InstancesByTriggeredAt defines the order based on the time of the ASG Shudown Lifecycle.
func LifecycleCompleted ¶
func LifecycleDeleted ¶
func PendingLifecycleCompletion
deprecated
func PodCanDecrement ¶
func PodImmuneToEviction ¶
func PodNotImmuneToEviction ¶ added in v2.3.0
func PodsByImmuneToEviction ¶
func PodsByNeedsEviction ¶
Types ¶
type Collectors ¶
type Instance ¶
type Instance struct { InstanceID string `logfield:"instance-id"` ASG asg.Instance `logfield:",squash"` EC2 ec2.Instance `logfield:",squash"` Spot spot.Instance `logfield:",squash"` Node node.Node `logfield:",squash"` Pods Pods `logfield:"-"` }
Instance is the combined data from different sources.
func (*Instance) HasASGData ¶
func (*Instance) HasEC2Data ¶
func (*Instance) HasEC2State ¶
func (*Instance) HasLifecycleMessage
deprecated
func (*Instance) HasNodeData ¶ added in v2.1.0
func (*Instance) NodeName ¶
NodeName returns the NodeName which it tries to get from Kubernetes or EC2 data. Returns an empty string, if the NodeName could not been determinated.
func (*Instance) PendingLifecycleCompletion
deprecated
func (Instance) PodStats ¶
func (instance Instance) PodStats() InstancePodStats
func (*Instance) WantsShutdown
deprecated
type InstancePodStats ¶
type InstanceSelector ¶
Selector is a function type that defines if an instance should be selected.
func HasEC2State ¶
func HasEC2State(states ...string) InstanceSelector
func HasSpotStatusCode ¶
func HasSpotStatusCode(codes ...string) InstanceSelector
func HasTaint ¶
func HasTaint(key string) InstanceSelector
func InstanceQuery ¶
func InstanceQuery() InstanceSelector
InstanceQuery returns a dummy selector that selects all instances. It is used to make chaining selectors prettier while making sure the type is correct.
Without:
InstanceSelector(HasEC2Data). Select(HasASGData). Filter(LifecycleDeleted)
With:
InstanceQuery(). Select(HasEC2Data). Select(HasASGData). Filter(LifecycleDeleted)
func LifecycleTriggeredOlderThan ¶
func LifecycleTriggeredOlderThan(age time.Duration) InstanceSelector
func (InstanceSelector) Any ¶
func (is InstanceSelector) Any(slice ...InstanceSelector) InstanceSelector
func (InstanceSelector) Filter ¶
func (s1 InstanceSelector) Filter(s2 InstanceSelector) InstanceSelector
func (InstanceSelector) FilterByAllPods ¶
func (is InstanceSelector) FilterByAllPods(ps PodSelector) InstanceSelector
func (InstanceSelector) Select ¶
func (s1 InstanceSelector) Select(s2 InstanceSelector) InstanceSelector
type Instances ¶
type Instances []Instance
Instances is a collection of Instance types with some additional functions.
func (Instances) Select ¶
func (instances Instances) Select(selector InstanceSelector) Instances
Select returns a subset of the instances based on the selector. The subset only contains instances, that match the selector.
func (Instances) Sort ¶
func (instances Instances) Sort(by InstancesBy) Instances
Sort returns a sorted list of instances based on the given sorter.
func (Instances) SortReverse ¶
func (instances Instances) SortReverse(by InstancesBy) Instances
SortReverse returns a sorted list of instances based on the given sorter. The output is reversed.
type InstancesBy ¶
InstancesBy is a function type that defines the order and is used by Sort and SortReverse.
type Pod ¶
func (*Pod) NeedsEviction
deprecated
type PodSelector ¶
Selector is a function type that defines if an instance should be selected and is used by Select and Filter.
func PodOnInstance ¶ added in v2.3.0
func PodOnInstance(instanceID string) PodSelector
func PodQuery ¶
func PodQuery() PodSelector
PodQuery returns a dummy selector that selects all pods. It is used to make chaining selectors prettier while making sure the type is correct. See InstanceQuery for an example.
func (PodSelector) Filter ¶
func (ps1 PodSelector) Filter(ps2 PodSelector) PodSelector
func (PodSelector) Select ¶
func (ps1 PodSelector) Select(ps2 PodSelector) PodSelector
func (PodSelector) SelectByInstance ¶
func (ps PodSelector) SelectByInstance(is InstanceSelector) PodSelector
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
aws
|
|
asg
Package asg provides an interface to ASG Lifecycle Hooks, that are delivered via SQS.
|
Package asg provides an interface to ASG Lifecycle Hooks, that are delivered via SQS. |
ec2
Package ec2 provides an interface to EC2 instances, that are polled from the API.
|
Package ec2 provides an interface to EC2 instances, that are polled from the API. |
spot
Package spot provides an interface to Spot requests, that are polled from the API.
|
Package spot provides an interface to Spot requests, that are polled from the API. |
kube
|
|