The controller currently uses k8s.io/kubectl/pkg/drain for node draining, which pulls in heavy dependencies for a fairly thin orchestration layer on top of the Eviction API (list pods, filter DaemonSet/mirror pods, evict with PDB retry, poll until deleted). A custom implementation would drop k8s.io/kubectl and k8s.io/cli-runtime and use the Eviction API directly. This should allow dropping the logwriter adapter we have, and possibly not require drain goroutines.
Issue originally reported by @jlebon in https://github.com/bootc-dev/bootc-operator/blob/main/docs/ARCHITECTURE.md
The controller currently uses
k8s.io/kubectl/pkg/drainfor node draining, which pulls in heavy dependencies for a fairly thin orchestration layer on top of the Eviction API (list pods, filter DaemonSet/mirror pods, evict with PDB retry, poll until deleted). A custom implementation would dropk8s.io/kubectlandk8s.io/cli-runtimeand use the Eviction API directly. This should allow dropping the logwriter adapter we have, and possibly not require drain goroutines.Issue originally reported by @jlebon in https://github.com/bootc-dev/bootc-operator/blob/main/docs/ARCHITECTURE.md