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

Add --extra-disks capability to kvm2 driver #12351

Merged
merged 1 commit into from
Aug 30, 2021

Conversation

raghavendra-talur
Copy link
Contributor

@raghavendra-talur raghavendra-talur commented Aug 25, 2021

Having additional disks on the nodes is a requirement for developers
working on the storage components in Kubernetes. This commit adds the
extra-disks feature to the kvm2 driver.

Output:

$ minikube start --profile msecondary --driver=kvm2 --network=mk-default --nodes=2 --extra-disks=3 --addons=olm
😄  [msecondary] minikube v1.22.0 on Fedora 34
    ▪ KUBECONFIG=/home/rtalur/.kube/config
✨  Using the kvm2 driver based on user configuration
👍  Starting control plane node msecondary in cluster msecondary
🔥  Creating kvm2 VM (CPUs=4, Memory=16384MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.21.3 on Docker 20.10.8 ...
❌  Unable to load cached images: loading cached images: stat /home/rtalur/.minikube/cache/images/docker.io/kubernetesui/dashboard_v2.1.0: no such file or directory
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring CNI (Container Networking Interface) ...
🔎  Verifying Kubernetes components...
    ▪ Using image quay.io/operator-framework/olm:v0.17.0
    ▪ Using image quay.io/operator-framework/upstream-community-operators:07bbc13
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass, olm

👍  Starting node msecondary-m02 in cluster msecondary
🔥  Creating kvm2 VM (CPUs=4, Memory=16384MB, Disk=20000MB) ...
🌐  Found network options:
    ▪ NO_PROXY=192.168.39.145
🐳  Preparing Kubernetes v1.21.3 on Docker 20.10.8 ...
    ▪ env NO_PROXY=192.168.39.145
🔎  Verifying Kubernetes components...

❗  /home/rtalur/.local/bin/kubectl is version 0.21.0-beta.1, which may have incompatibilites with Kubernetes 1.21.3.
    ▪ Want kubectl v1.21.3? Try 'minikube kubectl -- get pods -A'
🏄  Done! kubectl is now configured to use "msecondary" cluster and "default" namespace by default

Devices in the VMs:

$ minikube --profile msecondary node list
msecondary      192.168.39.145
msecondary-m02  192.168.39.92
{0} 14:57:31 rtalur@rastartower [~]
$ minikube --profile msecondary ssh -- lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    253:0    0 19.5G  0 disk
`-vda1 253:1    0 19.5G  0 part /mnt/vda1
vdb    253:16   0 19.5G  0 disk
vdc    253:32   0 19.5G  0 disk
vdd    253:48   0 19.5G  0 disk
{0} 14:57:43 rtalur@rastartower [~]
$ minikube --profile msecondary ssh --node msecondary-m02 -- lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    253:0    0 19.5G  0 disk
`-vda1 253:1    0 19.5G  0 part /mnt/vda1
vdb    253:16   0 19.5G  0 disk
vdc    253:32   0 19.5G  0 disk
vdd    253:48   0 19.5G  0 disk

Disk files on the host with the VM running and after the cleanup:

$ ls -lash ~/.minikube/machines/msecondary/*.rawdisk
4.0K -rw-r--r--. 1 qemu qemu 20G Aug 25 14:50 /home/rtalur/.minikube/machines/msecondary/msecondary-0.rawdisk
4.0K -rw-r--r--. 1 qemu qemu 20G Aug 25 14:50 /home/rtalur/.minikube/machines/msecondary/msecondary-1.rawdisk
4.0K -rw-r--r--. 1 qemu qemu 20G Aug 25 14:50 /home/rtalur/.minikube/machines/msecondary/msecondary-2.rawdisk
4.0G -rw-r--r--. 1 qemu qemu 20G Aug 25 14:59 /home/rtalur/.minikube/machines/msecondary/msecondary.rawdisk
{0} 14:59:20 rtalur@rastartower [~]
$ minikube --profile msecondary delete
🔥  Deleting "msecondary" in kvm2 ...
🔥  Deleting "msecondary-m02" in kvm2 ...
💀  Removed all traces of the "msecondary" cluster.
{0} 14:59:59 rtalur@rastartower [~]
$ ls -lash ~/.minikube/machines/msecondary/*.rawdisk
ls: cannot access '/home/rtalur/.minikube/machines/msecondary/*.rawdisk': No such file or directory

Signed-off-by: Raghavendra Talur raghavendra.talur@gmail.com

Having additional disks on the nodes is a requirement for developers
working on the storage components in Kubernetes. This commit adds the
extra-disks feature to the kvm2 driver.

Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 25, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @raghavendra-talur. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 25, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

nice work @raghavendra-talur do u mind adding in the PR description out of of example of using this PR ? and verifying the Disk was created ?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, raghavendra-talur

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2021
@raghavendra-talur
Copy link
Contributor Author

@medyagh Thanks for the quick review. I have updated the description with the output info.

@BlaineEXE Thanks for #11483. The blueprint helped a lot.

@medyagh medyagh changed the title Add extra disks capability to kvm2 driver Add extra disks capability to kvm2 driver through --extra-disks Aug 30, 2021
@medyagh medyagh changed the title Add extra disks capability to kvm2 driver through --extra-disks Add --extra-disks capability to kvm2 driver Aug 30, 2021
@medyagh medyagh merged commit 3469c77 into kubernetes:master Aug 30, 2021
@BlaineEXE
Copy link
Contributor

Thanks @raghavendra-talur for implementing this for kvm (Linux). I think having Linux and MacOS support for the feature is really good coverage as far as overall usability is concerned. Especially since KVM and Hyperkit are very fast hypervisors for their respective platforms.

And thanks @medyagh for being open to the feature in Minikube. This is going to make our documentation for helping users get started working on Rook a lot easier.

I don't have any time in the near future, but I think the final driver that would extend feature coverage to Windows users (a small user base I imagine) is to add support for VirtualBox. This driver is also supported on Linux and MacOS and so would add overlapping support to give users some more choice. Though with the new-ish Windows Subsystem for Linux, that might not even be a concern. Medya might have more insight into whether there are other Minikube drivers that would be beneficial to focus on.

@kfox1111
Copy link

@BlaineEXE With docker for desktop not being free anymore, the windows userbase may start growing.

@raghavendra-talur raghavendra-talur deleted the rtalur-add-disks-kvm2 branch September 18, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants