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 command for installing kubectl program #4697

Closed
afbjorklund opened this issue Jul 6, 2019 · 5 comments
Closed

Add command for installing kubectl program #4697

afbjorklund opened this issue Jul 6, 2019 · 5 comments
Labels
cmd/kubectl Issues with the "kubectl" command kind/feature Categorizes issue or PR as related to a new feature.

Comments

@afbjorklund
Copy link
Collaborator

afbjorklund commented Jul 6, 2019

Currently we either run kubectl for the user, or ask them to find the download themselves.

Since we already have a versioning and caching mechanism, we could also do it for them ?

So the minikube kubectl could grow two new options, one --install and one --prefix.

Where the prefix would default to /usr/local (needs sudo), but you could use e.g. $HOME

sudo minikube kubectl --install
minikube kubectl --install --prefix=$HOME

Note that for the second usage, the user would need to make sure to include it in $PATH.

Some distributions do it by default, while some use ~/bin and some use ~/.local/bin...


Reference #4684 and #3645

And also https://kubernetes.io/docs/tasks/tools/install-kubectl/ of course, including packages:

sudo apt-get install -y kubectl
su -c "yum install -y kubectl"
@afbjorklund afbjorklund added kind/feature Categorizes issue or PR as related to a new feature. cmd/kubectl Issues with the "kubectl" command labels Jul 6, 2019
@josedonizetti
Copy link
Member

josedonizetti commented Jul 6, 2019

Wonder if instead, we should support a minikube install? I really like the idea of removing the complexity of installation, but why stop at kubectl? There are other dependencies we could also install.

We have tasks to download automatically vm drivers like docker-driver-machine-kvm2 #4391 and docker-driver-machine-hyperkit #3975, but I'm not sure we could download those drivers on the .minikube folder, as they would not be in the PATH libmachine wouldn't find it, I haven't checked if libmachine allows one to pass a specific location to the driver, or if it supports a different environment variable but still I think a more specific way of installing/upgrading the drivers is useful.

wdyt?

@afbjorklund
Copy link
Collaborator Author

Mostly because we install those other components on the VM ? And I don't want to install docker.

The drivers are a special case, wonder if we shouldn't just bundle them (like the virtualbox one) ?
But yeah, downloading those are needed - but probably automatically, rather than a command.

We should use the same functions underneath, but not sure if we need a minikube install cmd.


Note that there are benefits to not install kubectl too, such as having multiple versions available.

We could also do some half-way approach, by printing the path to the kubectl (but not run it) ?

@josedonizetti
Copy link
Member

That's true, it wouldn't make sense to install docker or podman. And an install sounds too generic, better to stick with improving kubectl, I like both new flags ideas --install and --prefix.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jul 6, 2019

Typical usage:

$ minikube kubectl --install
💣  Failed to write kubectl: open /usr/local/bin/kubectl: permission denied
$ sudo minikube kubectl --install
$ 

or alternatively:

$ install $(minikube kubectl --path) /usr/local/bin
install: cannot remove '/usr/local/bin/kubectl': Permission denied
$ sudo install $(minikube kubectl --path) /usr/local/bin
$ 

The main plan for the machine drivers is to provide them as packages and improve documentation.
I think that ultimately we want to improve the packaging for linux, so it matches the other platforms ?

https://github.com/kubernetes/minikube#installation

  • brew cask install minikube

  • choco install minikube

  • sudo apt install minikube or
    su -c "yum install minikube"

Then we would also get some modern features like compression or checksums... Imagine that. ☺️
But I suppose we could also consider using the already provided .tar.gz (no XZ yet) and SHA512 ?

https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.15.md#client-binaries

  • 41M kubectl-linux-amd64
  • 13M kubernetes-client-linux-amd64.tar.gz

@afbjorklund afbjorklund added packaging Packaging issues and removed packaging Packaging issues labels Jul 6, 2019
@afbjorklund
Copy link
Collaborator Author

Request declined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/kubectl Issues with the "kubectl" command kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants