-
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
kubevirt addon: use KubeVirt CR instead of deprecated ConfigMap #12921
Conversation
Hi @zcahana. 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. |
Can one of the admins verify this patch? |
@zcahana do u mind sharing Before and After this PR with an example and output ? |
Well, the usage and the output of the addon enablement command hasn't changed: zvic@ZVICAHANA-D2LK:~/Workspace/minikube (kubevirt_configmap)$ ./out/minikube addons enable kubevirt
▪ Using image bitnami/kubectl:1.17
🌟 The 'kubevirt' addon is enabled Semantically, both before and after, we have a functional kubevirt installation. Internally, there are some differences (which also affect users who wish to tinker with KubeVirt configuration):
|
deploy/addons/kubevirt/pod.yaml.tmpl
Outdated
curl -sL "https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-cr.yaml" -o /manifests/kubevirt.yaml | ||
|
||
kubectl create -f /manifests/kubevirt.yaml | ||
kubectl patch kubevirt kubevirt -n kubevirt --type merge --patch '{"spec": {"configuration": {"developerConfiguration": {"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.
This definitely works, but in general our kubevirt-cr.yaml does not set any non-default option and for declarative kubevirt installs with kubevirt you can just apply
such a cr
:
apiVersion: kubevirt.io/v1
kind: KubeVirt
metadata:
name: kubevirt
namespace: kubevirt
spec: {}
Or in your case:
apiVersion: kubevirt.io/v1
kind: KubeVirt
metadata:
name: kubevirt
namespace: kubevirt
spec:
developerConfiguration:
useEmulation: true
So in stead of
curl -sL "https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-cr.yaml" -o /manifests/kubevirt-cr.yaml
just directly write the above content and you don't need to deal with patches or anything (and that is a feature and not a works-by-accident flow :) ).
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.
Updated accordingly.
Note that I too prefer the cat << EOF | kubectl apply -f -
syntax, but this doesn't work in this context since the above pod.yaml.tmpl
template is rendered using the html/template
pkg, which doesn't like the <<
.
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 great, at least for me.
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh, rmohr, zcahana The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Modify the kubevirt addon (#8275) to configure KubeVirt via its operator's custom resource (
KubeVirt
), instead of via the deprecated (andsoonsometime to be removed)kubevirt-config
ConfigMap.Also slight changes to the saved manifest file names (avoid confusing renames).