-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat: Add KubeVirt VirtualMachine custom health checks [#7175] #7176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
914af8a
to
a9c777f
Compare
@@ -0,0 +1,15 @@ | |||
hs = { status="Progressing", message="No status available"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a VMI, there's a stable .status.phase
field which can be used (alongside the Ready and Paused conditions).
Here's a reasonable mapping to Argo CD health states:
- Pending, Scheduling, Scheduled --> Progressing
- Succeeded --> Suspended (can also use Healthy but I think Suspended conveys the more significant aspect here)
- Failed --> Degraded (can also use Suspended and have the
hs.message
discriminate between Succeeded/Failed/Paused) - Unknown --> Unknown
- Running -->
- Paused --> Suspended
- !Ready --> Degraded
- Ready --> Healthy
@@ -0,0 +1,12 @@ | |||
hs = { status="Progressing", message="No status available"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can supplement the phase with the Running condition to try and expose errors:
- Succeeded --> Healthy
- Failed --> Degraded
- Unknown --> Unknown
- Paused --> Suspended
- Other phase + Running --> Progressing
- Other phase + !Running --> Degraded
a9c777f
to
6b6138e
Compare
resource_customizations/kubevirt.io/VirtualMachineInstance/health.lua
Outdated
Show resolved
Hide resolved
ed4fe4f
to
01fa9ec
Compare
Codecov Report
@@ Coverage Diff @@
## master #7176 +/- ##
==========================================
+ Coverage 41.10% 41.40% +0.29%
==========================================
Files 160 161 +1
Lines 21505 21622 +117
==========================================
+ Hits 8840 8952 +112
- Misses 11399 11408 +9
+ Partials 1266 1262 -4
Continue to review full report at Codecov.
|
Side question that shouldn't necessarily impact the merge: |
Yes! The basic examples I have been using are from KubeVirt's labs. The DataVolume can be created as soon as KubeVirt is up and running (lab1 on that site) Then there is a VirtualMachine to add, and the VirtualMachineInstance is created from the VM once it gets scheduled on a node. In normal usage, you would never directly create a VMI resource, only a VM or DV. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at this PR since it got put onto the Argo CD maintainer's agenda. I'm not familiar with Kubevirt, but it looks like @zcahana is, based on GitHub activity, so I'm trusting his feedback on this PR and would like him to sign off on it before merging.
resource_customizations/kubevirt.io/VirtualMachineInstance/health.lua
Outdated
Show resolved
Hide resolved
Thanks @jessesuen. @cwilkers please take a look at some previous review comments that have been made here, some of them are still outstanding, and IMO enables to provide a pretty solid/accurate status reporting in a rather simple manner (i.e., without complex logic). |
@zcahana, I was holding off another round of improvements until I had gotten the issue scoped for triage (while it was passing CI). I will integrate the feedback, test locally and push a commit/amend. Thanks @jessesuen, @zcahana ! |
01fa9ec
to
71137eb
Compare
@jessesuen @zcahana I have made the requested changes and everything tests okay locally. If you could take one more look, I'd appreciate it! |
resource_customizations/kubevirt.io/VirtualMachineInstance/health.lua
Outdated
Show resolved
Hide resolved
resource_customizations/kubevirt.io/VirtualMachineInstance/health.lua
Outdated
Show resolved
Hide resolved
resource_customizations/kubevirt.io/VirtualMachineInstance/health.lua
Outdated
Show resolved
Hide resolved
Looks good @cwilkers! See a few additional minor comments, after which I think we're good to go. |
Signed-off-by: cwilkers <cwilkers@redhat.com>
71137eb
to
93ac6f2
Compare
@cwilkers looks perfect now, thank you! |
@jessesuen Could I trouble you for another CI workflow run? |
Signed-off-by: cwilkers cwilkers@redhat.com
Checklist:
Fixes #7175 Resource Customizations for KubeVirt Data Types
This does not need to be in release notes nor docs
Red Hat appears in USERS.md