Documentation
¶
Overview ¶
Package devicetainteviction contains the logic implementing taint-based eviction for Pods using tainted devices (https://github.com/kubernetes/enhancements/issues/5055).
Index ¶
- type Controller
- type NOPQueue
- func (m *NOPQueue[T]) Add(item T)
- func (m *NOPQueue[T]) AddAfter(item T, duration time.Duration)
- func (m *NOPQueue[T]) AddRateLimited(item T)
- func (m *NOPQueue[T]) Done(item T)
- func (m *NOPQueue[T]) Forget(item T)
- func (m *NOPQueue[T]) Get() (item T, shutdown bool)
- func (m *NOPQueue[T]) Len() int
- func (m *NOPQueue[T]) NumRequeues(item T) int
- func (m *NOPQueue[T]) ShutDown()
- func (m *NOPQueue[T]) ShutDownWithDrain()
- func (m *NOPQueue[T]) ShuttingDown() bool
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 ¶
func New(c clientset.Interface, podInformer coreinformers.PodInformer, claimInformer resourceinformers.ResourceClaimInformer, sliceInformer resourceinformers.ResourceSliceInformer, ruleInformer resourcealphainformers.DeviceTaintRuleInformer, classInformer resourceinformers.DeviceClassInformer, controllerName string) *Controller
New creates a new Controller that will use passed clientset to communicate with the API server. Spawns no goroutines. That happens in Run.
type NOPQueue ¶
type NOPQueue[T comparable] struct { }
NOPQueue is an implementation of [TypedRateLimitingInterface] which doesn't do anything.
func (*NOPQueue[T]) AddRateLimited ¶
func (m *NOPQueue[T]) AddRateLimited(item T)
AddRateLimited implements [TypedRateLimitingInterface.AddRateLimited].
func (*NOPQueue[T]) Forget ¶
func (m *NOPQueue[T]) Forget(item T)
Forget implements [TypedRateLimitingInterface.Forget].
func (*NOPQueue[T]) NumRequeues ¶
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 ¶
ShuttingDown implements [TypedInterface].