-
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
Merged
+136
−0
Merged
Add KubeVirt addon #8275
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## kubevirt Addon | ||
[kubevirt](https://kubevirt.io/) - KubeVirt technology addresses the needs of development teams that have adopted or want to adopt Kubernetes but possess existing Virtual Machine-based workloads that cannot be easily containerized. | ||
|
||
More info can be found by reading the tutorial ["How to use KubeVirt with minikube"](https://minikube.sigs.k8s.io/docs/tutorials/kubevirt/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
namespace: kube-system | ||
name: kubevirt-scripts | ||
labels: | ||
kubernetes.io/minikube-addons: kubevirt | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
data: | ||
uninstall.sh: | | ||
#!/bin/bash | ||
|
||
kubectl delete -f /manifests/kubevirt.yaml | ||
|
||
kubectl delete -f /manifests/kubevirt-base.yaml | ||
|
||
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 commentThe 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 :) |
||
echo $KUBEVIRT_VERSION | ||
|
||
curl -Ls "https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml" -o /manifests/kubevirt-base.yaml | ||
|
||
kubectl create -f /manifests/kubevirt-base.yaml | ||
|
||
EMULATION=$(egrep 'svm|vmx' /proc/cpuinfo) | ||
if [ -z "$EMULATION" ]; then | ||
echo "use emulation" | ||
kubectl create configmap kubevirt-config -n kubevirt --from-literal debug.useEmulation=true | ||
fi; | ||
|
||
curl -sL "https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-cr.yaml" -o /manifests/kubevirt.yaml | ||
|
||
kubectl create -f /manifests/kubevirt.yaml | ||
|
||
sleep infinity | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
kubernetes.io/minikube-addons: kubevirt | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
name: kubevirt-install-manager | ||
namespace: kube-system | ||
spec: | ||
containers: | ||
- command: | ||
- /bin/bash | ||
- -c | ||
- /kubevirt-scripts/install.sh | ||
image: bitnami/kubectl:1.17 | ||
imagePullPolicy: IfNotPresent | ||
name: kubevirt-provisioner | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: | ||
- /bin/bash | ||
- -c | ||
- /kubevirt-scripts/uninstall.sh | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
volumeMounts: | ||
- mountPath: /manifests | ||
name: tmp | ||
- mountPath: /kubevirt-scripts | ||
name: kubevirt-scripts | ||
terminationGracePeriodSeconds: 60 | ||
volumes: | ||
- name: tmp | ||
emptyDir: {} | ||
- name: kubevirt-scripts | ||
configMap: | ||
defaultMode: 0777 | ||
name: kubevirt-scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: "How to use KubeVirt with minikube" | ||
linkTitle: "KubeVirt support" | ||
weight: 1 | ||
date: 2020-05-26 | ||
description: > | ||
Using KubeVirt with minikube | ||
--- | ||
|
||
## Prerequisites | ||
|
||
- kvm2 driver | ||
|
||
### Enable KubeVirt on minikube | ||
Minikube can be started with default values and those will be enough to run a quick example, that being said, if you can spare a few more GiBs of RAM (by default it uses 2GiB), it’ll allow you to experiment further. | ||
|
||
We’ll create a profile for KubeVirt so it gets its own settings without interfering what any configuration you might have already, let’s start by increasing the default memory to 4GiB: | ||
|
||
```shell script | ||
minikube config -p kubevirt set memory 4096 | ||
minikube config -p kubevirt set vm-driver kvm2 | ||
minikube start -p kubevirt | ||
``` | ||
|
||
To enable this addon, simply run: | ||
```shell script | ||
minikube addons enable kubevirt | ||
``` | ||
|
||
In a minute or so kubevirt's default components will be installed into your cluster. | ||
You can run `kubectl get pods -n kubevirt` to see the progress of the kubevirt installation. | ||
|
||
|
||
### Disable KubeVirt | ||
To disable this addon, simply run: | ||
```shell script | ||
minikube addons disable kubevirt | ||
``` | ||
|
||
### More Information | ||
|
||
See official [Minikube Quickstart](https://kubevirt.io/quickstart_minikube/) documentation for more information and to install KubeVirt without using the addon. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.