Skip to content
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

Merged
merged 1 commit into from
May 4, 2023
Merged

Conversation

gursewak1997
Copy link
Member

@gursewak1997 gursewak1997 commented Apr 4, 2023

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

@gursewak1997 gursewak1997 requested a review from dustymabe April 4, 2023 18:09
Copy link
Member

@dustymabe dustymabe left a 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.
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment on lines 75 to 79
.Accessing the VM instance using kubectl via ssh
[source, bash]
----
kubectl virt ssh core@my-fcos
----
Copy link
Member

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.

Comment on lines 80 to 79
.Accessing the VM instance using virtctl via ssh
[source, bash]
----
virtctl ssh core@my-fcos
----
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.Mirroring a fcos image from stable stream
.Mirroring a stable stream FCOS image


.Launching a VM instance referencing the secret
[source, bash]
----
Copy link
Member

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'

Comment on lines 23 to 25
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.
Copy link
Member

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:

Suggested change
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...

Comment on lines 17 to 19
----
quay.io/fedora/fedora-coreos-kubevirt
----
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

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

Suggested change
cat << END > vmi.yaml
cat <<END > vmi.yaml

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dustymabe
Copy link
Member

This branch has conflicts that must be resolved

@gursewak1997 gursewak1997 merged commit 8144898 into coreos:main May 4, 2023
@gursewak1997 gursewak1997 deleted the kubevirt-docs branch May 4, 2023 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants