Describe the bug
When USE_APISERVER_CACHE was introduced in #1018, it calls DeleteOrEvictPods with a list of pods that NTH has retrieved to avoid the ETCD quorum read.
The problem with calling this function directly as it by-passes any of the pre-filtering performed by kubectl drainer interface to ensure that certain Pods like those owned by a Daemonset are not evicted. This is why NTH calls RunNodeDrain which does encompass those checks.
Steps to reproduce
Configure NTH with both USE_APISERVER_CACHE and IGNORE_DAEMON_SETS - observe DaemonSet Pods are evicted.
Expected outcome
DaemonSet Pods are not evicted.
Application Logs
Environment
- NTH App Version: v1.22.1
- NTH Mode (IMDS/Queue processor): Queue Processor
- OS/Arch:
- Kubernetes version:
- Installation method: Helm Chart