kubevirt / demo

Easy to use KubeVirt demo based on minikube.
Apache License 2.0
109 stars 59 forks source link

[WIP] Add minishift detection to demo #22

Closed xsgordon closed 6 years ago

xsgordon commented 6 years ago

As of minishift 1.7.0 it is also able to support KubeVirt. This change adds detection to determine whether minishift is installed/running as an alternative to minikube, and uses whichever is "up".

This currently does however make the assumption that if either is up then it is the desired target for kubevirt AND what kubectl is configured to use. If both are up, which is possible on the same system, then it will use whatever installation kubectl is currently configured for.

This feels somewhat hacky, but still provides a workable way to use whichever one is available to get started.

fabiand commented 6 years ago

@xsgordon were you able to deploy KubeVirt onminishift? and were you successful?

The patch looks alright to me.

xsgordon commented 6 years ago

The script completed successfully but still poking to confirm this is working correctly, consider WIP for now.

xsgordon commented 6 years ago

Right now it looks like although there is a new minishift 1.7.0 minishift binary after deleting the existing install and doing a fresh start it's still pulling v3.6.0 container images into the guest it creates.

Will figure out if there is a way to point it at v3.7.0-alpha.1, which leads to the change I need to make to this PR - right now I don't have a version check in there. In the minishift case (probably minikube as well) I should check that what is there is in fact >= 1.7.0 and not just assume.

fabiand commented 6 years ago

I'd expect that there are some RBAC etc issues.

xsgordon commented 6 years ago

Indeed, looks like it chokes on the manifests to start with:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.0", GitCommit:"d3ada0119e776222f11ec7945e6d860061339aad", GitTreeState:"clean", BuildDate:"2017-06-29T23:15:59Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.0+695f48a16f", GitCommit:"d2e5420", GitTreeState:"clean", BuildDate:"2017-08-29T21:57:44Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
$ ./run-demo.sh 
KubeVirt (29c790a77b613c08518db7e7e24c1d55439899a3) demo on minikube
- Checking kubectl version ... OK
- Checking for minikube/minishift ... OK
- Checking out KubeVirt ... OK
- Deploying manifests - this can take several minutes!
error: unable to recognize "cluster/vm.json": no matches for kubevirt.io/, Kind=VirtualMachine
- Waiting for the cluster to be ready ...
  Cluster changed, checking if KubeVirt is ready ... Yes!
KubeVirt is now ready.
Optional, register the virt plugin for VM access:
  ./run-demo.sh plug
Try: $ kubectl get vms
$ kubectl get pods
NAME                               READY     STATUS    RESTARTS   AGE
haproxy-3327841641-hq9mb           0/1       Pending   0          25m
spice-proxy-3310133143-2p8h8       0/1       Pending   0          25m
virt-api-2926652329-gc9m2          0/1       Pending   0          25m
virt-controller-1142550110-rx70f   0/1       Pending   0          25m
xsgordon commented 6 years ago

Looking at the sed statements in _op_manifests() there is obviously some more stuff to conditionalize here that I missed. Sure enough once I fix these and run them individually there are a heap of issues with resources that cant be created at the given scope even as the system or cluster admin accounts.

fabiand commented 6 years ago

There are a few things - especially RBAC and missing cluster/pod which should block minishift - or any openshift - deployment atm.

rmohr commented 6 years ago

@xsgordon there is a post from @admiyo who managed to deploy kubevirt on origin-master. Maybe that helps too: http://adam.younglogic.com/2017/08/deploying-kubevirt-on-origin-master/

xsgordon commented 6 years ago

Closing this, it's still something that needs to be done but clearly needs a bit more work than I envisaged. Thanks for the link to Adam's post it is very helpful.