-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add KubeVirt addon #8275
Add KubeVirt addon #8275
Conversation
Welcome @ashleyschuett! |
Hi @ashleyschuett. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ashleyschuett The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Can one of the admins verify this patch? |
Codecov Report
@@ Coverage Diff @@
## master #8275 +/- ##
==========================================
- Coverage 34.46% 34.37% -0.09%
==========================================
Files 147 147
Lines 9428 9469 +41
==========================================
+ Hits 3249 3255 +6
- Misses 5780 5814 +34
- Partials 399 400 +1
|
/assign @sharifelgamal |
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.
thank you for adding this addon, this looks good just minior nits !
@@ -0,0 +1,45 @@ | |||
## kubevirt Addon |
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.
@ashleyschuett
thank you for adding this readme, could u please this read me to our site section ?
maybe under tutorials ?
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.
Hey, I added the readme under the tutorials section. Would you like the readme in the deploy folder to be removed, or is it okay for it to live in both places?
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.
thank you we can have a readme in the addon folder but with a link to the website, so anyone goes to that can find out where is the tutorial for this addon.
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.
@ashleyschuett it is awesome to finally see this PR. Many thanks.
A few notes inside.
deploy/addons/kubevirt/README.md
Outdated
To disable this addon, simply run: | ||
```shell script | ||
minikube addons disable kubevirt | ||
minikube addons disable kubevirt-provisioner |
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.
@ashleyschuett what about sqashing these two commands into one (just kubevirt).
If somebody wants to separate operator deployment from kubevirt deployment then the user can just do it manually using the yamls.
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.
After looking into this a bit and trying to get this to work I am unable to.
The issue is if we enable kubevirt with a single command, it then also needs to be able to be disabled. When disabling all the manifests get removed at the same time. In this case, the operator deletes much quicker than the KubeVirt CR. When this happens the CR will still have a finalizer and will get stuck in a terminating state along with the namespace since the operator is gone and unable to remove it.
I attempted to hook into the "preStop" lifecycle of the container but while the pod will then wait to delete it will still be in the "terminating" state meaning that the validating webhook will not respond and the kubevirt cr will not delete.
Because of this, I think the options are to keep the deployments/commands as is. Or if we change them to be kubevirt
and kubevirt-with-emulation
then in the read me we have the user create the kubevirt CR, and let them know to remove it before disabling the addon. Does either of the options sound okay? Or is there another way to get around the previously mentioned issue?
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.
Nice catch. And sad.
Now, I dislike to say it, but what about writing a pod which does all this:
- Deployment on creation and start
- Undeploy on deletion of the pod
The reason that I think that this could work is, because we can set a terminationGrace period on the pod - which gives the pod some time to complete - and inside the pod we can just serialize the deleition of the CR and the followed deletion of the operator.
What do you think?
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 what you mean by this is that the enable/disable would only be deploying a pod, which would then have / run a script that would match the minikube quick start documentation we have? Then on disable delete the resources in the proper order?
The only problem I see what that is that namespace would still need to be created first in the manifests, and it would then also be deleted first which would mean that the operator deployment could be deleted before the pod runs the deletion.
I have changed the minikube code to delete resources in the opposite that they are created in, but i think that would need buy in from more people in this project.
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 have update the addon to use your suggestions, let me know what you think!
``` | ||
If the command does not generate any output, create the following ConfigMap so that KubeVirt uses emulation mode, otherwise skip to the next section: | ||
```shell script | ||
kubectl create configmap kubevirt-config -n kubevirt --from-literal debug.useEmulation=true |
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.
As discussed:
We can consider doing this with two options:
kubevirt -- regular
kubevirt -with-emmulation -- if emualation is needed to workaround missing kvm
@@ -0,0 +1,60 @@ | |||
--- | |||
title: "KubeVirt support" |
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 would change this to a
How To... format, for example how to use KubeVirt with minikube
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.
this has been updated! and the PR is ready for a rereview!
a616a80
to
5dafe6b
Compare
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.
@ashleyschuett this looks good. If this works, then this is pretty cool!
install.sh: | | ||
#!/bin/bash | ||
|
||
export KUBEVIRT_VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases | grep tag_name | grep -v -- - | sort -V | tail -1 | awk -F':' '{print $2}' | sed 's/,//' | xargs) |
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.
Ha. Nifty, nice to see that this is not the naive approach of retrieving the highest version :)
/ok-to-test |
kvm2 Driver |
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.
looks good to me, thank you for adding this addon @ashleyschuett
Description
This PR fixes #2178
It adds the KubeVirt operator as an addon that can be enabled, as well as allowing users to separately create an instance of the KubeVirt custom resource to deploy the full environment.