Documentation ¶
Index ¶
Constants ¶
const ( MetricsNameKillPod = "kill_pod" MetricsNameKillContainer = "kill_container" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsynchronizedPodKiller ¶
AsynchronizedPodKiller pushed killing actions into a queue and returns true directly, another go routine will be responsible to perform killing actions instead.
func (*AsynchronizedPodKiller) EvictPod ¶
func (a *AsynchronizedPodKiller) EvictPod(rp *rule.RuledEvictPod) error
func (*AsynchronizedPodKiller) EvictPods ¶
func (a *AsynchronizedPodKiller) EvictPods(rpList rule.RuledEvictPodList) error
func (*AsynchronizedPodKiller) Name ¶
func (a *AsynchronizedPodKiller) Name() string
func (*AsynchronizedPodKiller) Start ¶
func (a *AsynchronizedPodKiller) Start(ctx context.Context)
type ContainerKiller ¶ added in v0.4.0
type ContainerKiller struct {
// contains filtered or unexported fields
}
ContainerKiller implements Killer interface it actually does not evict pod but stop containers in given pod directly.
func (*ContainerKiller) Name ¶ added in v0.4.0
func (c *ContainerKiller) Name() string
type DeletionAPIKiller ¶
type DeletionAPIKiller struct {
// contains filtered or unexported fields
}
DeletionAPIKiller implements Killer interface it evict those given pods by calling pod deletion API.
func (*DeletionAPIKiller) Name ¶
func (d *DeletionAPIKiller) Name() string
type DummyKiller ¶
type DummyKiller struct{}
DummyKiller is a stub implementation for Killer interface.
func (DummyKiller) Name ¶
func (d DummyKiller) Name() string
type DummyPodKiller ¶
type DummyPodKiller struct{}
DummyPodKiller is a stub implementation for Killer interface.
func (DummyPodKiller) EvictPod ¶
func (d DummyPodKiller) EvictPod(*rule.RuledEvictPod) error
func (DummyPodKiller) EvictPods ¶
func (d DummyPodKiller) EvictPods(rule.RuledEvictPodList) error
func (DummyPodKiller) Name ¶
func (d DummyPodKiller) Name() string
func (DummyPodKiller) Start ¶
func (d DummyPodKiller) Start(_ context.Context)
type EvictionAPIKiller ¶
type EvictionAPIKiller struct {
// contains filtered or unexported fields
}
EvictionAPIKiller implements Killer interface it evict those given pods by eviction API, and wait until pods have actually been deleted.
func (*EvictionAPIKiller) Name ¶
func (e *EvictionAPIKiller) Name() string
type InitFunc ¶ added in v0.4.0
type InitFunc func(conf *config.Configuration, client kubernetes.Interface, recorder events.EventRecorder, emitter metrics.MetricEmitter) (Killer, error)
type Killer ¶
type Killer interface { // Name returns name as identifier for a specific Killer. Name() string // Evict for given pods and corresponding graceful period seconds. Evict(ctx context.Context, pod *v1.Pod, gracePeriodSeconds int64, reason, plugin string) error }
Killer implements pod eviction logic.
func NewContainerKiller ¶ added in v0.4.0
func NewContainerKiller(conf *config.Configuration, _ kubernetes.Interface, recorder events.EventRecorder, emitter metrics.MetricEmitter) (Killer, error)
func NewDeletionAPIKiller ¶
func NewDeletionAPIKiller(_ *config.Configuration, client kubernetes.Interface, recorder events.EventRecorder, emitter metrics.MetricEmitter) (Killer, error)
func NewEvictionAPIKiller ¶
func NewEvictionAPIKiller(_ *config.Configuration, client kubernetes.Interface, recorder events.EventRecorder, emitter metrics.MetricEmitter) (Killer, error)
NewEvictionAPIKiller returns a new updater Object.
type PodKiller ¶
type PodKiller interface { // Name returns name as identifier for a specific Killer. Name() string // Start pod killer logic, prepare to receive on-killing pods. Start(ctx context.Context) // EvictPods send on-killing pods to pod killer. EvictPods(rpList rule.RuledEvictPodList) error // EvictPod a pod with the specified grace period. EvictPod(rp *rule.RuledEvictPod) error }
PodKiller implements the killing actions for given pods.
func NewAsynchronizedPodKiller ¶
func NewAsynchronizedPodKiller(killer Killer, client kubernetes.Interface) PodKiller
type SynchronizedPodKiller ¶
type SynchronizedPodKiller struct {
// contains filtered or unexported fields
}
SynchronizedPodKiller trigger killing actions immediately after receiving killing requests; only returns true if all pods are successfully evicted.
func (*SynchronizedPodKiller) EvictPod ¶
func (s *SynchronizedPodKiller) EvictPod(rp *rule.RuledEvictPod) error
func (*SynchronizedPodKiller) EvictPods ¶
func (s *SynchronizedPodKiller) EvictPods(rpList rule.RuledEvictPodList) error
func (*SynchronizedPodKiller) Name ¶
func (s *SynchronizedPodKiller) Name() string
func (*SynchronizedPodKiller) Start ¶
func (s *SynchronizedPodKiller) Start(_ context.Context)