PoC: offload DP/DRA management to KMM#59
Draft
abyrne55 wants to merge 1 commit into
Draft
Conversation
Replace direct DevicePlugin and DRA DaemonSet management with a single KMM (Kernel Module Management) Module CR. Two controllers collapse into one, and the operator no longer needs to build DaemonSets, manage RBAC, handle pod readiness, or construct OpenShift SCCs at runtime. RBAC, SCC, ValidatingAdmissionPolicy, and DeviceClass resources have been moved from operator-managed code into Helm templates and kustomize overlays. A new optional kernelModule CRD field enables OOT driver loading via KMM when set. Signed-off-by: Anthony Byrne <abyrne@redhat.com>
Contributor
|
Hi @abyrne55 ! Thanks for the PoC!
I'm still thinking if I'd like to have DP/DRA deployment also in the base-operator side. For anyone not wanting to deploy KMM to their cluster. Both methods could use the same building blocks so there wouldn't be too much overhead. More testing though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces the operator's direct DP/DRA DaemonSet management with a single KMM (Kernel Module Management)
ModuleCR. Two controllers collapse into one, and the operator no longer needs to build DaemonSets, manage RBAC, handle pod readiness, or construct OpenShift SCCs at runtime.DevicePluginReconciler,DRAReconciler)KMMReconciler)Existing ClusterPolicy specs work unchanged — KMM is used transparently under the hood.
Beyond simplifying what we already have, KMM also brings capabilities we'd otherwise need to build: OOT kernel module loading (see new CRD field below), kernel-version-aware rollouts, ordered upgrades, pre-flight validation, and build/sign integration. Ordered upgrades and pre-flight validation apply immediately for OOT driver modules; build/sign integration is available when needed.
How it works
A new
KMMReconcilersub-controller replacesDevicePluginReconcilerandDRAReconcilerin the reconcile loop. It usescontrollerutil.CreateOrPatchto manage the Module CR idempotently, withSetControllerReferenceso the Module is garbage-collected when the ClusterPolicy is deleted.DRA RBAC (ServiceAccount, ClusterRole, ClusterRoleBinding), OpenShift SCCs, and ValidatingAdmissionPolicy resources have been moved out of operator-managed code and into deployment tooling (Helm templates and kustomize overlays).
KMM availability is detected at startup via API group discovery (
kmm.sigs.x-k8s.io), same pattern asDRAEnable. If the CRD isn't installed, the operator starts normally and reports an error in ClusterPolicy status.New CRD field
When
kernelModuleis set, KMM loads the specified OOT driver module on each node. When omitted, the in-tree kernel driver is used.Known limitations
mod.Spec.DevicePlugin) is implemented and unit-tested but hasn't been validated on a cluster.Test results
Tested on OCP 4.22.2 (SNO) with two Intel Arc Pro B70 GPUs. KMM and NFD pre-installed.
/dev/dridevicesmake testpasses (102/102 specs including 8 KMM controller tests)This PR was written in part with the assistance of generative AI.