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

Implement socket_vmnet network (QEMU) #14989

Merged
merged 10 commits into from
Oct 3, 2022

Conversation

spowelljr
Copy link
Member

@spowelljr spowelljr commented Sep 21, 2022

Closes #15038
Closes #14692

Implemented socket_vmnet network for the QEMU driver

minikube start:

$ minikube start --driver qemu --network socket_vmnet
πŸ˜„  minikube v1.27.0 on Darwin 12.6 (arm64)
✨  Using the qemu2 (experimental) driver based on user configuration
❗  Using qemu with 'socket_vmnet' network is experimental
πŸ‘  Starting control plane node minikube in cluster minikube
πŸ”₯  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.25.1 on Docker 20.10.18 ...
    β–ͺ Generating certificates and keys ...
    β–ͺ Booting up control plane ...
    β–ͺ Configuring RBAC rules ...
πŸ”Ž  Verifying Kubernetes components...
    β–ͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: default-storageclass, storage-provisioner
πŸ„  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

minikube service:

$ kubectl create deployment hello-minikube --image=docker.io/nginx:1.23
$ kubectl expose deployment hello-minikube --type=NodePort --port=80
$ minikube service hello-minikube
|-----------|----------------|-------------|----------------------------|
| NAMESPACE |      NAME      | TARGET PORT |            URL             |
|-----------|----------------|-------------|----------------------------|
| default   | hello-minikube |          80 | http://192.168.105.2:32037 |
|-----------|----------------|-------------|----------------------------|
πŸŽ‰  Opening service default/hello-minikube in default browser...
$ curl 192.168.105.2:32037
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
...

minikube tunnel:

$ kubectl create deployment balanced --image=docker.io/nginx:1.23
$ kubectl expose deployment balanced --type=LoadBalancer --port=80
$ minikube tunnel

# in new terminal window
$ kubectl get services balanced
NAME       TYPE           CLUSTER-IP     EXTERNAL-IP    PORT(S)        AGE
balanced   LoadBalancer   10.101.76.73   10.101.76.73   80:30925/TCP   22s
$ curl 10.101.76.73:80
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
...

starting with user network (backwards-compatibility)

$ minikube start --driver qemu
πŸ˜„  minikube v1.27.0 on Darwin 12.6 (arm64)
✨  Using the qemu2 (experimental) driver based on user configuration
❗  The default network for QEMU will change from 'user' to 'socket_vmnet' in a future release
❗  You are using the QEMU driver without a dedicated network, which doesn't support `minikube service` & `minikube tunnel` commands.
To try the experimental dedicated network see: https://minikube.sigs.k8s.io/docs/drivers/qemu/#networking
πŸ‘  Starting control plane node minikube in cluster minikube
πŸ”₯  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.25.1 on Docker 20.10.18 ...
    β–ͺ Generating certificates and keys ...
    β–ͺ Booting up control plane ...
    β–ͺ Configuring RBAC rules ...
πŸ”Ž  Verifying Kubernetes components...
    β–ͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass
πŸ„  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 21, 2022
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 21, 2022
@spowelljr spowelljr force-pushed the socketVMNet branch 3 times, most recently from f6587cc to 1e57e04 Compare September 21, 2022 21:20
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 21, 2022
@spowelljr spowelljr force-pushed the socketVMNet branch 2 times, most recently from fbc8685 to 1525689 Compare September 26, 2022 20:04
@spowelljr spowelljr changed the title WIP: Implement socket_vmnet Implement socket_vmnet Sep 26, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 26, 2022
@spowelljr spowelljr changed the title Implement socket_vmnet Implement socket_vmnet network (QEMU) Sep 26, 2022
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.

the PR looks good to me except we need a documentation page, and also I think we might wanna change the name "socket" to be something more meaningful

I hate to use overloaded words, socket means a lot of things in many worlds.

how about we use a name like "socket_vmnet" or "lima_socket" ?

I also like to know what @afbjorklund thinks

cmd/minikube/cmd/start_flags.go Outdated Show resolved Hide resolved
Copy link
Contributor

@eiffel-fl eiffel-fl left a comment

Choose a reason for hiding this comment

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

I was able to create a minikube cluster with network=socket_vmnet and running the service subcommand.

I have some comments but nothing really serious(mainly translation even though they are not perfect):

cmd/minikube/cmd/start_flags.go Show resolved Hide resolved
pkg/drivers/qemu/qemu.go Show resolved Hide resolved
translations/fr.json Outdated Show resolved Hide resolved
translations/fr.json Outdated Show resolved Hide resolved
translations/fr.json Outdated Show resolved Hide resolved
translations/fr.json Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 29, 2022
@medyagh medyagh self-requested a review October 3, 2022 21:39
pkg/drivers/common.go Outdated Show resolved Hide resolved
pkg/drivers/common.go Outdated Show resolved Hide resolved
Copy link
Contributor

@klaases klaases 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, well done!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: klaases, medyagh, spowelljr

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

@spowelljr spowelljr merged commit e961a52 into kubernetes:master Oct 3, 2022
@spowelljr spowelljr deleted the socketVMNet branch October 3, 2022 23:16
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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement socket_vmnet network (QEMU) prototype minikube qemu driver with dedicated network
6 participants