-
Notifications
You must be signed in to change notification settings - Fork 130
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
Document how to use KubeVirt #528
Conversation
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.
some comments
Here the Ignition config is exposed to the VMI via a Kubernetes Secret. | ||
Learn about various ways to expose userdata to VMIs in the https://kubevirt.io/user-guide/virtual_machines/startup_scripts/#startup-scripts[KubeVirt user guide]. | ||
|
||
NOTE: You must edit the following commands per your container management system. For example, you must replace `kubectl` with `oc` if you use Openshift. |
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.
You can actually use kubectl
with OpenShift, it just doesn't support everything. Maybe just update the note
here to say if the user prefers they can use oc
instead of kubectl
.
Now that you have an image it can be used in your VMI definitions. The following example will use the image from the stable stream. | ||
|
||
You'll also need the Ignition config. | ||
Here the Ignition config is exposed to the VMI via a Kubernetes Secret. |
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.
Here the Ignition config is exposed to the VMI via a Kubernetes Secret. | |
In the example below the Ignition config stored in local file `example.ign` is exposed to the VMI via a Kubernetes Secret. |
.Accessing the VM instance using kubectl via ssh | ||
[source, bash] | ||
---- | ||
kubectl virt ssh core@my-fcos | ||
---- |
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 just drop this since it requires a plugin being installed for kubectl.
.Accessing the VM instance using virtctl via ssh | ||
[source, bash] | ||
---- | ||
virtctl ssh core@my-fcos | ||
---- |
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.
would be nice if we could link to some docs about virtctl
here, but I don't there really are any. Could you find some?
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 can only see https://kubevirt.io/user-guide/operations/virtctl_client_tool/ which is decent and will help to install virtctl for users who don't have it installed. You've probably already seen this option but there really isn't any other good option.
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.
That looks great. Let's use that.
.Mirroring a fcos image from stable stream | ||
[source, bash] | ||
---- | ||
skopeo copy docker://quay.io/coreos/fedora-coreos:stable docker://myregistry.io/myorg/fedora-coreos:stable |
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.
skopeo copy docker://quay.io/coreos/fedora-coreos:stable docker://myregistry.io/myorg/fedora-coreos:stable | |
skopeo copy docker://quay.io/coreos/fedora-coreos-kubevirt:stable docker://myregistry.io/myorg/fedora-coreos-kubevirt:stable |
|
||
== Mirroring the image for use in private registries | ||
|
||
If a private registry in air-gapped installations is used, the image can be mirrored to that registry. |
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.
If a private registry in air-gapped installations is used, the image can be mirrored to that registry. | |
If a private registry in air-gapped installations is used, the image can be mirrored to that registry using https://github.com/containers/skopeo[`skopeo`]. |
|
||
If a private registry in air-gapped installations is used, the image can be mirrored to that registry. | ||
|
||
.Mirroring a fcos image from stable stream |
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.
.Mirroring a fcos image from stable stream | |
.Mirroring a stable stream FCOS image |
e326a03
to
8c5205b
Compare
|
||
.Launching a VM instance referencing the secret | ||
[source, bash] | ||
---- |
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.
Let's let the user choose the stream here in the example:
STREAM='stable' # or 'testing' or 'next'
Now that you have an image it can be used in your VMI definitions. The following example will use the image from the stable stream. | ||
|
||
You'll also need the Ignition config. |
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.
Let's drop the reference to the stream here (we'll select that below) in the "code" and also combine a few sentences:
Now that you have an image it can be used in your VMI definitions. The following example will use the image from the stable stream. | |
You'll also need the Ignition config. | |
Given the `quay.io/fedora/fedora-coreos-kubevirt` images you can create a VMI defnition and combine that with an Ignition config to launch a machine. | |
In the example below... |
---- | ||
quay.io/fedora/fedora-coreos-kubevirt | ||
---- |
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.
maybe let's just go ahead and make this a bulleted list and list out the three options:
quay.io/fedora/fedora-coreos-kubevirt:stable
quay.io/fedora/fedora-coreos-kubevirt:testing
quay.io/fedora/fedora-coreos-kubevirt:next
memory: 2048M | ||
volumes: | ||
- containerDisk: | ||
image: quay.io/coreos/fedora-coreos:stable |
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.
image: quay.io/coreos/fedora-coreos:stable | |
image: quay.io/coreos/fedora-coreos:${STREAM} |
.Launching a VM instance referencing the secret | ||
[source, bash] | ||
---- | ||
cat << END > vmi.yaml |
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.
optional/preference: remove the space
cat << END > vmi.yaml | |
cat <<END > vmi.yaml |
8c5205b
to
9cc0559
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.
LGTM
|
9cc0559
to
580a533
Compare
e9c6557
to
d797f67
Compare
Document how to get starting with FCOS on KubeVirt.
https://pagure.io/fedora-web/websites/pull-request/241 will add KubeVirt to the GetFedora page.
Ref: coreos/fedora-coreos-tracker#1126