-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
WIP: kubernetes: add VMs and VM/VMInstance details #8948
Conversation
Are the offline VMs the ones that says n/a? |
Offline vm does not have any state by itself so there can be any empty placeholder. Although offline vm includes state of it's running vm, like:
|
@andreasn @garrett @serenamarie125 @beanh66 |
@suomiy Apologies for the delay, I've been on vacation. Let me mock something up and send it your way asap! |
@suomiy Can you provide a screenshot of what the disks section looks like for one of the expanded list view items? Also curious where this page is in the UI? It sounds like we are updating the existing virtual machines page, correct? |
@suomiy I have a few questions, but I took a first pass at this design:
|
thanks
yes
No, we do not need that column. I put it there to just show the difference
Pending, Scheduling, Scheduled, Running, Not Running, Succeeded, Failed, Unknown. It should be like that also in OpenShift
That is a good idea
It does not change in cockpit and we would like to keep it that way so it is consistent with other lists.
We would like to bundle together vm and offline vm to one list item (unlike this screenshot)
We could also have two rows of tabs instead
Also the Delete has different meaning in vm and offline vm.
|
@suomiy Thank you for providing that context and additional information. We've discussed similar use cases around how to display vms and ovms inside of OpenShift. I have been holding off on updating the design until we come to some agreement on this piece in OpenShift to be sure we remain consistent across products. We have another meeting this Wednesday, so I will follow-up by the end of the week. Tagging @jniederm here as well because he has started on this effort for OpenShift. @serenamarie125 @xsgordon FYI |
@beanh66 Any updates? |
@suomiy We just got back from summit, but will provide an update by the end of the week based on the latest work in OpenShift for vms/ovms. Just FYI there have been a number of relevant discussions on the KubeVirt and cnv mailing lists as well. |
@suomiy We sent out a survey on 5/18 to get user feedback on two different approaches for displaying vms and ovms in OpenShift. Will keep you informed on the feedback we get and the direction that implementation is going! |
@suomiy A few updates: Based on the CNV designs and the new entity names, I updated the original design to the following:
|
@beanh66 Thanks a lot! I will start implementing it. Only one caveat. I think we will have keep the tabs there, because not everything can fit there. Currently there is Overview, Usage (WIP) and Disks. The usage especiallym, but even the disks have 5 columns. |
@suomiy Oh got it, okay no problem on the tabs. |
updated TODO and split this PR |
dfe2a29
to
ec8d823
Compare
I implemented VM and VM Instance detail + VMs page with @beanh66 's redesign in mind. Entities are ported to use new kubevirt v0.7.0 API and terminology VMs/kubernetes#/vms
Details/kubernetes#/vms/default/myvm/kubernetes#/vmis/myproject/testvm
Note: Continuation of #9466 which can be merged first and depends on the old API Please let me know if there are any issues with the design |
8a8c08b
to
ec8d823
Compare
ec8d823
to
a4b0db9
Compare
3974351
to
66cf394
Compare
@suomiy This is looking great! Three questions, |
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.
Pretty complex one for review :-)
Eager to try.
Most important review comment: To keep or not to keep Redux state across page navigation, that is the question.
@@ -20,14 +20,25 @@ | |||
(function() { | |||
"use strict"; | |||
|
|||
/* Expose jQuery and Bootstrap to non-Angular code */ | |||
var jquery = require('jquery/dist/jquery.js'); |
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.
Shouldn't this go somewhere higher in the hierarchy?
If this hack is needed, it should be available even without virtual machines
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.
It is needed only for virtual machines because angular has it's own version of jQuery
and angular-bootstrap-npm
is used. There is no other non-angular code in kubernetes
so it is sufficient to leave it only here. I would move it higher when new use case occurs.
const VmDisksTabKubevirt = ({ vm, pvs }: { vm: Vm, pvs: Array<PersistenVolume> }) => { | ||
const idPrefix = `${vmIdPrefx(vm)}-disks`; | ||
const DisksTabKubevirt = ({ vm, pvs }: { vm: Vm | Vmi, pvs: Array<PersistenVolume> }) => { | ||
const idPrefix = prefixedId(kindIdPrefx(vm), 'disks'); |
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.
nit: Let's enjoy the simplicity :-)
test/verify/check-openshift
Outdated
# The "fedoravm" VirtualMachine is created from OfflineVirtualMachine | ||
o.execute("oc patch offlinevirtualmachine fedoravm --type=merge -p '{\"spec\":{\"running\": true}}'") # let's start the VM | ||
print("starting vm, might take a while") | ||
wait(lambda: "fedoravm" in o.execute("oc get vm"), msg='Start of the "fedoravm" virtual machine failed.', delay=2) | ||
wait(lambda: "virt-launcher-fedoravm" in o.execute("oc get pods"), delay=2) | ||
wait(lambda: "Running" in o.execute("oc get pods | grep virt-launcher-fedoravm"), delay=2, tries=150) # Example: virt-launcher-fedoravm-----rx59t | ||
|
||
def testBrowserLocation(self, url): |
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.
use of test
as prefix for function name is ambiguous in this context (it's not actual test)
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.
thanks, I forgot I misnamed it this way
test/verify/check-openshift
Outdated
# The "fedoravm" VirtualMachine is created from OfflineVirtualMachine | ||
o.execute("oc patch offlinevirtualmachine fedoravm --type=merge -p '{\"spec\":{\"running\": true}}'") # let's start the VM | ||
print("starting vm, might take a while") | ||
wait(lambda: "fedoravm" in o.execute("oc get vm"), msg='Start of the "fedoravm" virtual machine failed.', delay=2) | ||
wait(lambda: "virt-launcher-fedoravm" in o.execute("oc get pods"), delay=2) | ||
wait(lambda: "Running" in o.execute("oc get pods | grep virt-launcher-fedoravm"), delay=2, tries=150) # Example: virt-launcher-fedoravm-----rx59t | ||
|
||
def testBrowserLocation(self, url): |
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.
Please rename, this is not actual test
test/verify/check-openshift
Outdated
b = self.browser | ||
|
||
b.wait_present( | ||
"#vm-fedoravm-cpu-metric div svg") # cannot check cpu component because it is an external dependency |
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.
no need to break the line, IMO
@@ -42,9 +53,23 @@ | |||
'$locationProvider', | |||
function($routeProvider, $locationProvider) { | |||
$routeProvider | |||
.when('/vms', { | |||
.when(paths.VMS, { |
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 think I wrote this somewhere already.
The drawback of this approach is the need to re-initialize redux all the time the page changes.
Works ok now but what if we will need to keep state between navigation?
Does it make sense to route /vms
(or similar) URL context via angular and then leave sub-context on react (like react-router or even some super-simple custom implementation - see pkg/machines
for an example)?
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.
yes, we discussed this in #9466
Yes, but we also want the possibility to navigate to the single vm. And we want the redux store to represent only what the application needs. Plus almost all the data is cached by kube-client and the request to get the node metrics are occurring once a few seconds anyway.
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.
Works ok now but what if we will need to keep state between navigation?
actually we are keeping the same store alive between the redirections, we are just throwing out most of the data we don't need, so this use-case is possible
I wanted the state to be somewhere visible (possibly close to the original location in the list). There is also an "extra" When I look at it now, I think labels should be probably at the end because they can potentially take up a lot of space.
Yes, it is the default behaviour in Cockpit and kubernetes plugin
Sorry I uploaded wrong content. VM should have |
@suomiy How about on the left column you have Memory, CPU, Pod, VMI and on the right column you have state, age, node, labels? |
57400ef
to
10b1f6b
Compare
@beanh66 Good suggestion! Final version: VMsVMVM InstanceResponsive |
@mareklibra I also changed |
…nce details + other changes - rename OfflineVirtualMachine -> VirtualMachine - rename VirtualMachine -> VirtualMachineInstance - kubernetes#/vms shows VirtualMachines instead of VirtualMachineInstances - links in vms redirect to detail pages - visual changes in tabs and details (age,..) - refactor and add new flow types - general refactoring - kube-client: add VirtualMachine type
fixed few bugs (mainly metrics) |
kubevirt/kubevirt#1320 needs to be fixed together with the kubevirt image #9638 |
Due to insufficient maintenance, and kubevirt UI moving to Tectonic/Quay, we are removing the kubevirt bits from Cockpit now. Details: |
discussed in #8895
functionality:
Todo: