podkiller

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const MetricsNameKillPod = "kill_pod"

Variables

This section is empty.

Functions

This section is empty.

Types

type AsynchronizedPodKiller

type AsynchronizedPodKiller struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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 (*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 DeletionAPIKiller

type DeletionAPIKiller struct {
	// contains filtered or unexported fields
}

DeletionAPIKiller implements Killer interface it evict those given pods by calling pod deletion API.

func NewDeletionAPIKiller

func NewDeletionAPIKiller(client kubernetes.Interface, recorder events.EventRecorder, emitter metrics.MetricEmitter) *DeletionAPIKiller

func (*DeletionAPIKiller) Evict

func (d *DeletionAPIKiller) Evict(ctx context.Context, pod *v1.Pod, gracePeriodSeconds int64, reason string) error

func (*DeletionAPIKiller) Name

func (d *DeletionAPIKiller) Name() string

type DummyKiller

type DummyKiller struct{}

DummyKiller is a stub implementation for Killer interface.

func (DummyKiller) Evict

func (d DummyKiller) Evict(_ context.Context, _ *v1.Pod, _ int64, _ string) error

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 (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 NewEvictionAPIKiller

func NewEvictionAPIKiller(client kubernetes.Interface, recorder events.EventRecorder, emitter metrics.MetricEmitter) *EvictionAPIKiller

NewEvictionAPIKiller returns a new updater Object.

func (*EvictionAPIKiller) Evict

func (e *EvictionAPIKiller) Evict(_ context.Context, pod *v1.Pod, gracePeriodSeconds int64, reason string) error

func (*EvictionAPIKiller) Name

func (e *EvictionAPIKiller) Name() string

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 string) error
}

Killer implements pod eviction logic.

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

func NewSynchronizedPodKiller

func NewSynchronizedPodKiller(killer Killer) 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

Jump to

Keyboard shortcuts

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