kubernetesk8s.io/kubernetes/pkg/controller/devicetainteviction Index | Files | Directories

package devicetainteviction

import "k8s.io/kubernetes/pkg/controller/devicetainteviction"

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

Index

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

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

Source Files

device_taint_eviction.go doc.go

Directories

PathSynopsis
pkg/controller/devicetainteviction/metrics
Version
v1.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
34 packages
Last checked
3 hours ago

Tools for package owners.