feat: plumb EventRecorder and emit failure events - #221
Conversation
✅ Deploy Preview for dranet canceled.
|
|
@fmuyassarov one last push |
on it |
should be ready now |
|
/hold |
3830ae9 to
0d5824f
Compare
should be fixed now and is ready to another round of review. |
|
@fmuyassarov my apologies, I didn't see before the events were sent on clean up, I prefer not to send them there ... you remove those and we merge |
No worries and that makes sense. It is cleaned up now. |
This commit adds eventRecorder to the driver and as a starting point we record and publish only the following failure events: ClaimPrepareFailed, NetworkDeviceAttachFailed, RDMADeviceAttachFailed. Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@est.tech>
|
rebased with required changes after #223 landed |
|
/lgtm Thanks for your patience |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aojea, fmuyassarov The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
thanks for reviewing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add eventRecorder to the driver and as a starting point we record and publish only the following failure events: ClaimPrepareFailed, NetworkDeviceAttachFailed, RDMADeviceAttachFailed.
One thing I wasn't fully convinced about was the benefit of propagating the event into the driver logs via ...
This basically replicates the event into the kubectl logs of the driver. In a way I don't see an issue propagating it to the logs and it may help to discovery the failures a bit faster but at the same time I'm thinking that publishing the failure in the events is enough. I don't have a strong opinion on this and would be happy to hear you think on this.
in practice in looks like this
Which issue(s) this PR is related to:
Fixes: #194
Special notes for your reviewer:
I tried to do bare minimum end to end testing and tried to mimic the failure to test at least
ClaimPrepareFailedevent on a resourceClaim when it can not prepare a device.The idea was that I create a dummy interface and it is published in the resourceSlice as available device. Then I install the deviceClass and send
SIGSTOPsignal to the driver pod so that it can't process requests, this is basically to kind of break/pause the pod. Then I deleted the dummy interface while the driver can't process any changes. Finally, I created a sort of workload pod with resourceClaim. So at this point schedular tries to allocate dummy interface since it is available on the resourceSlice (driver isn't aware or didn't have a chance to rescan the devices since we broke it intentionally). Now kubelet makes nodePrepareResources call and then I sendSIGCONTsignal to the driver Pod so that it starts handling the request but it fails to find the device now since we deleted the interface and returns an error from which we create an event. Sorry if this was long but I could not come up with better idea of testing.Below are some snippets from my test if that helps to review:
Does this PR introduce a user-facing change?