devicetainteviction

package
v1.35.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Overview

Package devicetainteviction contains the logic implementing taint-based eviction for Pods using tainted devices (https://github.com/kubernetes/enhancements/issues/5055).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller listens to Taint changes of DRA devices and Toleration changes of ResourceClaims, then deletes Pods which use ResourceClaims that don't tolerate a NoExecute taint. Pods which have already reached a final state (aka terminated) don't need to be deleted.

All of the logic which identifies pods which need to be evicted runs in the handle* event handlers. They don't call any blocking method. All the blocking calls happen in a tainteviction.TimedWorkerQueue, using the context passed to Run.

The [resourceslicetracker] takes care of applying taints defined in DeviceTaintRules to ResourceSlices. This controller here receives modified ResourceSlices with all applicable taints from that tracker and doesn't need to care about where a taint came from, the DRA driver or a DeviceTaintRule.

func New

New creates a new Controller that will use passed clientset to communicate with the API server. Spawns no goroutines. That happens in Run.

func (*Controller) Run

func (tc *Controller) Run(ctx context.Context, numWorkers int) error

Run starts the controller which will run until the context is done. An error is returned for startup problems.

type NOPQueue

type NOPQueue[T comparable] struct {
}

NOPQueue is an implementation of [TypedRateLimitingInterface] which doesn't do anything.

func (*NOPQueue[T]) Add

func (m *NOPQueue[T]) Add(item T)

Add implements [TypedInterface].

func (*NOPQueue[T]) AddAfter

func (m *NOPQueue[T]) AddAfter(item T, duration time.Duration)

AddAfter implements [TypedDelayingInterface.AddAfter]

func (*NOPQueue[T]) AddRateLimited

func (m *NOPQueue[T]) AddRateLimited(item T)

AddRateLimited implements [TypedRateLimitingInterface.AddRateLimited].

func (*NOPQueue[T]) Done

func (m *NOPQueue[T]) Done(item T)

Done implements [TypedInterface].

func (*NOPQueue[T]) Forget

func (m *NOPQueue[T]) Forget(item T)

Forget implements [TypedRateLimitingInterface.Forget].

func (*NOPQueue[T]) Get

func (m *NOPQueue[T]) Get() (item T, shutdown bool)

Get implements [TypedInterface].

func (*NOPQueue[T]) Len

func (m *NOPQueue[T]) Len() int

Len implements [TypedInterface].

func (*NOPQueue[T]) NumRequeues

func (m *NOPQueue[T]) NumRequeues(item T) int

NumRequeues implements [TypedRateLimitingInterface.NumRequeues].

func (*NOPQueue[T]) ShutDown

func (m *NOPQueue[T]) ShutDown()

ShutDown implements [TypedInterface].

func (*NOPQueue[T]) ShutDownWithDrain

func (m *NOPQueue[T]) ShutDownWithDrain()

ShutDownWithDrain implements [TypedInterface].

func (*NOPQueue[T]) ShuttingDown

func (m *NOPQueue[T]) ShuttingDown() bool

ShuttingDown implements [TypedInterface].

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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