squat / generic-device-plugin

A Kubernetes device plugin to schedule generic Linux devices
Apache License 2.0
208 stars 23 forks source link

plugin: implement correct startup ordering #35

Closed squat closed 1 year ago

squat commented 1 year ago

Strictly speaking, device plugins must start their gRPC servers and be ready to accept connections / serve requests before they register themselves with the Kubelet to avoid race conditions and device allocation issues.

This commit fixes the startup order implemented by the generic device plugin. It starts the gRPC server and waits for it to be running and accepting connections before registering itself. The new server initialization function is interruptible and compatible with the run.Group abstraction used in this project.

Signed-off-by: Lucas Servén Marín lserven@gmail.com

squat commented 1 year ago

This fixes the issue described in https://github.com/squat/generic-device-plugin/issues/33#issuecomment-1632858707.