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

Adds better information for using kubectl inside minikube #8519

Conversation

Harkishen-Singh
Copy link
Contributor

Signed-off-by: Harkishen-Singh harkishensingh@hotmail.com

Fixes: #7642

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 20, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @Harkishen-Singh. 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 20, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Harkishen-Singh
To complete the pull request process, please assign medyagh
You can assign the PR to them by writing /assign @medyagh in a comment when ready.

The full list of commands accepted by this bot can be found 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

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 20, 2020
@Harkishen-Singh
Copy link
Contributor Author

/assign @medyagh

@afbjorklund
Copy link
Collaborator

Not sure I agree with "workaround", but I guess it is the best we can do here since we don't agree on the recommendation.

@afbjorklund
Copy link
Collaborator

If you want to add additional tips to the documentation, you could add the "alias" as in #7289

It would need the regular warnings and caveats, for people using inferior shells and such...

But avoids having to type out the full minikube kubectl -- every time:

alias kubectl='minikube kubectl --'

@Harkishen-Singh
Copy link
Contributor Author

If you want to add additional tips to the documentation, you could add the "alias" as in #7289

That would be great! However, according to that issue, do we aim to remove the -- support? If yes, then at that point, we need to change this doc as well.

@afbjorklund
Copy link
Collaborator

I'm not sure it is possible to change the flag parsing of subcommands, without changing a lot of minikube internals (cobra/viper)

However, if the user don't have to type it anyway - does it really matter ? We could have a command to print out the path as well.
If you prefer running ~/.minikube/cache/linux/v1.18.3/kubectl over the wrapper (which does handle os and version for you)
Adding that directory to the PATH would be pretty much the same as "installing" it. Well, without the sudo requirement that is.

@afbjorklund
Copy link
Collaborator

Typically, the logging of the path to the kubectl binary was broken: #8521

@Harkishen-Singh
Copy link
Contributor Author

@afbjorklund for now, I have added the alias as a tip for easier usage.

@TravisBuddy
Copy link

Travis tests have failed

Hey @Harkishen-Singh,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

View build log

make test
which go-bindata || GO111MODULE=off GOBIN="/home/travis/gopath/bin" go get github.com/jteeuwen/go-bindata/...
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.13.8.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
gofmt -s -w pkg/minikube/assets/assets.go
which go-bindata || GO111MODULE=off GOBIN="/home/travis/gopath/bin" go get github.com/jteeuwen/go-bindata/...
/home/travis/gopath/bin/go-bindata
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.13.8.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/...
gofmt -s -w pkg/minikube/translate/translations.go
MINIKUBE_LDFLAGS="-X k8s.io/minikube/pkg/version.version=v1.12.0-beta.0 -X k8s.io/minikube/pkg/version.isoVersion=v1.11.0 -X k8s.io/minikube/pkg/version.isoPath=minikube/iso -X k8s.io/minikube/pkg/version.gitCommitID="56b3e032263250c2f3923ca4489bf618ca5e8005"" ./test.sh
= make lint =============================================================
golangci/golangci-lint info checking GitHub for tag 'v1.26.0'
golangci/golangci-lint info found version: 1.26.0 for v1.26.0/linux/amd64
Makefile:371: recipe for target 'out/linters/golangci-lint-v1.26.0' failed
make[1]: *** [out/linters/golangci-lint-v1.26.0] Error 35
= go mod ================================================================
ok
= boilerplate ===========================================================
ok
Makefile:273: recipe for target 'test' failed
make: *** [test] Error 4
TravisBuddy Request Identifier: 08c4c8e0-b2f4-11ea-894e-97d5968798bd

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

add kubectl install link

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

add alias tip to the minikube docs

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

remove debug statements

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>
@Harkishen-Singh Harkishen-Singh force-pushed the tip-for-minikube-based-kubectl-usage branch from c4bf24b to 30e6660 Compare June 20, 2020 12:50
@medyagh
Copy link
Member

medyagh commented Jun 21, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 21, 2020
@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [65.013723838 63.31281343300001 64.74056281600001]
Average time for minikube: 64.355700029

Times for Minikube (PR 8519): [63.83693271899999 64.09232711599999 63.11254784999999]
Average time for Minikube (PR 8519): 63.68060256166666

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 8519) |
+--------------------------------+-----------+--------------------+
| * minikube v1.11.0 on Debian   |  0.059522 |                    |
|                           9.11 |           |                    |
| * Using the kvm2 driver based  |  0.019486 |           0.020424 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.003337 |           0.003245 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 41.063278 |          40.512296 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.3 | 21.477444 |          21.632348 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.227133 |           1.155975 |
| components...                  |           |                    |
| * Enabled addons:              |  0.432485 |           0.227320 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.069132 |           0.068389 |
| configured to use "minikube"   |           |                    |
|                                |  0.003884 |           0.056614 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [26.326640263999998 27.272461795 27.806236437000003]
Average time for minikube: 27.135112831999994

Times for Minikube (PR 8519): [27.56035686 26.322113223999995 27.498897887]
Average time for Minikube (PR 8519): 27.127122656999997

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 8519) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.11.0 on Debian           |  0.072718 |                    |
|                                   9.11 |           |                    |
| * Using the docker driver              |  0.002694 |           0.002724 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.056817 |           0.059320 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  7.564288 |           7.536347 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.3         |  0.115872 |           0.119045 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.065829 |          18.418594 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  1.088686 |           0.845981 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.093625 |           0.002731 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.070223 |           0.064967 |
| configured to use "minikube"           |           |                    |
|                                        |  0.004361 |           0.073189 |
+----------------------------------------+-----------+--------------------+

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.

thank you for this PR ! this will make the user's life easier

@medyagh medyagh merged commit c609b3f into kubernetes:master Jun 22, 2020
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

direct user to using minikube's inner kubectl when not installed
7 participants