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

None driver #1173

Merged
merged 2 commits into from
May 26, 2017
Merged

None driver #1173

merged 2 commits into from
May 26, 2017

Conversation

aaron-prindle
Copy link
Contributor

@aaron-prindle aaron-prindle commented Feb 23, 2017

This is a rough prototype of a minikube no-vm driver which moves all files into local locations and runs them as it does in the vm. All CLI commands are preserved. Currently the MINIKUBE_HOME directory needs to be configured and minikube start needs to be run as root.
To test:

export MINIKUBE_HOME=$HOME #REQUIRED TO PROPERLY CONFIGURE .kube and .minikube dir
export CHANGE_MINIKUBE_NONE_USER=true #REQUIRED TO CHANGE OWNERSHIP FROM root to the original $SUDO_USER
sudo /usr/local/bin/minikube start --vm-driver=none --use-vendored-driver
kubectl get po --all-namespaces
#The following commands are to show that the minikube CLI still works
minikube logs
minikube status
minikube ssh
minikube addons disable dashboard
minikube delete

Note: This requires requires docker installed on the host

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 23, 2017
@dims
Copy link
Member

dims commented Feb 23, 2017

@aaron-prindle does it support the case where docker is not installed/configured? thanks!

@aaron-prindle
Copy link
Contributor Author

aaron-prindle commented Feb 23, 2017

@dims no, unfortunately this method would require having docker installed on the host machine

@dims
Copy link
Member

dims commented Feb 23, 2017

Ack thanks i was scratching my head to see what i missed when i was poking at docker machine code before i ended up with #1152

@justechn
Copy link

I would love to see either this pull request or this one move forward. I think the idea is great and if it could work on a mac that would be even better.

@aaron-prindle aaron-prindle force-pushed the minikube-no-vm branch 10 times, most recently from 3f20952 to f859f5a Compare April 17, 2017 18:25
@codecov-io
Copy link

codecov-io commented Apr 17, 2017

Codecov Report

Merging #1173 into master will decrease coverage by 0.93%.
The diff coverage is 15.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1173      +/-   ##
==========================================
- Coverage   40.45%   39.52%   -0.94%     
==========================================
  Files          50       50              
  Lines        2477     2548      +71     
==========================================
+ Hits         1002     1007       +5     
- Misses       1312     1375      +63     
- Partials      163      166       +3
Impacted Files Coverage Δ
cmd/minikube/cmd/env.go 64.39% <0%> (-3.61%) ⬇️
pkg/minikube/machine/client_linux.go 21.05% <0%> (-15.32%) ⬇️
pkg/minikube/machine/client.go 55.75% <0%> (-1.01%) ⬇️
cmd/minikube/cmd/ssh.go 10.52% <0%> (-6.15%) ⬇️
cmd/minikube/cmd/mount.go 5% <0%> (-0.2%) ⬇️
cmd/minikube/cmd/status.go 16.66% <0%> (ø) ⬆️
cmd/minikube/cmd/start.go 17.05% <0%> (-1.42%) ⬇️
pkg/minikube/cluster/cluster_linux.go 0% <0%> (ø) ⬆️
pkg/minikube/cluster/commands.go 57.89% <100%> (ø) ⬆️
pkg/minikube/cluster/cluster.go 45.96% <31.57%> (-2.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5e4d45...f4a8ece. Read the comment docs.

@aaron-prindle aaron-prindle force-pushed the minikube-no-vm branch 2 times, most recently from 0495b0d to 44f99fc Compare April 17, 2017 23:23
@aaron-prindle
Copy link
Contributor Author

@minikube-bot retest this please

@aaron-prindle aaron-prindle changed the title WIP Prototype none driver None driver Apr 18, 2017
@aaron-prindle
Copy link
Contributor Author

@minikube-bot retest this please

@aaron-prindle aaron-prindle force-pushed the minikube-no-vm branch 3 times, most recently from c4b1ec3 to d7b44b1 Compare April 25, 2017 16:16
@aaron-prindle aaron-prindle force-pushed the minikube-no-vm branch 8 times, most recently from 5e37b36 to 9079795 Compare May 19, 2017 18:02
@omeid
Copy link
Contributor

omeid commented May 20, 2017

Landing this would be great. The kvm vm eats way too much battery on my laptop :(

Is there anything pending?

@dlorenc
Copy link
Contributor

dlorenc commented May 20, 2017

Landing this would be great. The kvm vm eats way too much battery on my laptop :(

I think this is pretty close, but we still won't really recommend using it on a laptop. localkube/kubernetes assume quite a bit of freedom on the host machine.

@omeid
Copy link
Contributor

omeid commented May 21, 2017

Well, that is fair, at least I would be able to put on a compute instance somewhere then :)

}

if os.Getenv("CHANGE_MINIKUBE_NONE_USER") != "" {
username := os.Getenv("SUDO_USER")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we bail out if this isn't set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, will continue with no additional chown if SUDO_USER is not set

if config.VMDriver == "none" {
fmt.Println(`===================
WARNING: IT IS RECOMMENDED NOT TO RUN THE NONE DRIVER ON PERSONAL WORKSTATIONS
The 'none' driver will run an insecure kubernetes apiserver as root that may leave the host vulnerable to attacks
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify that these are CSRF attacks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


if os.Getenv("CHANGE_MINIKUBE_NONE_USER") != "" {
username := os.Getenv("SUDO_USER")
command := fmt.Sprintf("/bin/chown %s %s", username, targetPath)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use os.Chown and os.Chgrp instead of shelling out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. Also os.Chown appears to do the work of both chown and chgrp

@aaron-prindle
Copy link
Contributor Author

aaron-prindle commented May 26, 2017

Should also add precreate check for systemd
Edit: Done

@aaron-prindle aaron-prindle force-pushed the minikube-no-vm branch 6 times, most recently from a8f18a5 to ec583d2 Compare May 26, 2017 19:56
@aaron-prindle
Copy link
Contributor Author

@minikube-bot retest this please

Copy link
Contributor

@dlorenc dlorenc left a comment

Choose a reason for hiding this comment

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

Nice!

limitations under the License.
*/

package drivers
Copy link
Contributor

Choose a reason for hiding this comment

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

We can do this in another PR later, but this should probably get moved into a subdirectory so we can have multiple drivers in here. Right now drivers.Driver will be this.

@aaron-prindle aaron-prindle merged commit a7c2ff3 into kubernetes:master May 26, 2017
@ernie
Copy link

ernie commented Jun 6, 2017

Hey folks. I arrived here via #99 (comment) and I'm wondering if it's still the intention to eventually use this to support running directly in Docker for Mac, or that's no longer the direction D4M users should be looking to go, since it looks like the existing --vm-driver=none implementation panics when not run inside a Linux vm.

@dlorenc
Copy link
Contributor

dlorenc commented Jun 6, 2017

This driver isn't intended to allow direct d4m use.

We're looking at a few better options for Mac integration, but the current thinking is still to use our own VM, but re-use the d4m tooling: #1543

@ernie
Copy link

ernie commented Jun 6, 2017

@dlorenc thanks for the speedy response and the pointer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ready-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants