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

Set --wait=false to default but still wait for apiserver #5757

Merged
merged 11 commits into from
Oct 29, 2019

Conversation

priyawadhwa
Copy link

@priyawadhwa priyawadhwa commented Oct 28, 2019

This PR changes --wait=false to be the default, but to still check for the apiserver in this case. If wait=true, we still wait for all pods to be up and running. This change should speed up minikube start, since we won't have to wait for other pods which can take a longer time to start up.

Ref #5681

Output now looks like:

$ ./out/minikube start 
😄  minikube v1.5.0-beta.0 on Darwin 10.14.6
🔥  Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.16.1 on Docker 18.09.9 ...
🚜  Pulling images ...
🚀  Launching Kubernetes ... 
⌛  Waiting for: apiserver
🏄  Done! kubectl is now configured to use "minikube"


$ ./out/minikube delete
🔥  Deleting "minikube" in hyperkit ...
💔  The "minikube" cluster has been deleted.
🔥  Successfully deleted profile "minikube"


$ ./out/minikube start --wait true
😄  minikube v1.5.0-beta.0 on Darwin 10.14.6
💡  Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
🔄  Starting existing hyperkit VM for "minikube" ...
⌛  Waiting for the host to be provisioned ...
🐳  Preparing Kubernetes v1.16.1 on Docker 18.09.9 ...
🔄  Relaunching Kubernetes using kubeadm ... 
⌛  Waiting for: apiserver proxy etcd scheduler controller dns
🏄  Done! kubectl is now configured to use "minikube"

$ ./out/minikube stop
✋  Stopping "minikube" in hyperkit ...
🛑  "minikube" stopped.

$ ./out/minikube start
😄  minikube v1.5.0-beta.0 on Darwin 10.14.6
💡  Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
🔄  Starting existing hyperkit VM for "minikube" ...
⌛  Waiting for the host to be provisioned ...
🐳  Preparing Kubernetes v1.16.1 on Docker 18.09.9 ...
🔄  Relaunching Kubernetes using kubeadm ... 
⌛  Waiting for: apiserver
🏄  Done! kubectl is now configured to use "minikube"

TODO:

  • look into writing unit tests
  • look into how this effects integration tests

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 28, 2019
@codecov-io
Copy link

codecov-io commented Oct 28, 2019

Codecov Report

Merging #5757 into master will increase coverage by 0.02%.
The diff coverage is 37.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5757      +/-   ##
==========================================
+ Coverage   37.83%   37.86%   +0.02%     
==========================================
  Files         106      106              
  Lines        7773     7796      +23     
==========================================
+ Hits         2941     2952      +11     
- Misses       4452     4464      +12     
  Partials      380      380
Impacted Files Coverage Δ
pkg/minikube/bootstrapper/bootstrapper.go 0% <ø> (ø) ⬆️
cmd/minikube/cmd/start.go 20.39% <16.66%> (-0.07%) ⬇️
pkg/minikube/bootstrapper/kubeadm/kubeadm.go 21.44% <42.3%> (+1.59%) ⬆️

Priya Wadhwa added 3 commits October 28, 2019 10:45
This PR changes --wait=false to be the default, but to still check for the apiserver in this case. If wait=true, we still wait for all pods to be up and running. This change should speed up `minikube start`, since we won't have to wait for other pods which can take a longer time to start up.

Ref kubernetes#5681
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 28, 2019
@priyawadhwa
Copy link
Author

Running mkcmp on this branch vs master on my Mac with hyperkit show significant speedup:

Logs

$ ./out/mkcmp ./out/master.minikube ./out/wait_false.minikube 
2019/10/28 10:34:13 Executing run 0...
2019/10/28 10:34:13 Running: [./out/master.minikube start]...
😄  minikube v1.5.0 on Darwin 10.14.6
🔥  Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.16.2 on Docker 18.09.9 ...
🚜  Pulling images ...
🚀  Launching Kubernetes ... 
⌛  Waiting for: apiserver proxy etcd scheduler controller dns
🏄  Done! kubectl is now configured to use "minikube"
2019/10/28 10:36:50 Running: [./out/wait_false.minikube start]...
😄  minikube v1.5.0 on Darwin 10.14.6
🔥  Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.16.2 on Docker 18.09.9 ...
🚜  Pulling images ...
🚀  Launching Kubernetes ... 
⌛  Waiting for: apiserver
🏄  Done! kubectl is now configured to use "minikube"
2019/10/28 10:38:04 Executing run 1...
2019/10/28 10:38:04 Running: [./out/master.minikube start]...
😄  minikube v1.5.0 on Darwin 10.14.6
🔥  Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.16.2 on Docker 18.09.9 ...
🚜  Pulling images ...
🚀  Launching Kubernetes ... 
⌛  Waiting for: apiserver proxy etcd scheduler controller dns
🏄  Done! kubectl is now configured to use "minikube"
2019/10/28 10:40:42 Running: [./out/wait_false.minikube start]...
😄  minikube v1.5.0 on Darwin 10.14.6
🔥  Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.16.2 on Docker 18.09.9 ...
🚜  Pulling images ...
🚀  Launching Kubernetes ... 
⌛  Waiting for: apiserver
🏄  Done! kubectl is now configured to use "minikube"
2019/10/28 10:41:59 Executing run 2...
2019/10/28 10:41:59 Running: [./out/master.minikube start]...
😄  minikube v1.5.0 on Darwin 10.14.6
🔥  Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.16.2 on Docker 18.09.9 ...
🚜  Pulling images ...
🚀  Launching Kubernetes ... 
⌛  Waiting for: apiserver proxy etcd scheduler controller dns
🏄  Done! kubectl is now configured to use "minikube"
2019/10/28 10:44:32 Running: [./out/wait_false.minikube start]...
😄  minikube v1.5.0 on Darwin 10.14.6
🔥  Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.16.2 on Docker 18.09.9 ...
🚜  Pulling images ...
🚀  Launching Kubernetes ... 
⌛  Waiting for: apiserver
🏄  Done! kubectl is now configured to use "minikube"
Old binary: [151.380704891 152.648160101 147.704785009]
New binary: [69.619480977 71.68093154 66.499298735]
Average Old: 150.577883
Average New: 69.266570

Old binary: [151.380704891 152.648160101 147.704785009]
New binary: [69.619480977 71.68093154 66.499298735]
Average Old: 150.577883
Average New: 69.266570

@medyagh medyagh added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Oct 28, 2019
@medyagh
Copy link
Member

medyagh commented Oct 28, 2019

wow what a big difference, I am curious which one of the integration tests would need to pass --wait=false

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 28, 2019
@sharifelgamal
Copy link
Collaborator

/ok-to-test

@tstromberg
Copy link
Contributor

tstromberg commented Oct 28, 2019

Do you mind confirming that kubectl get po -A returns non-zero content with this PR?

minikube start && kubectl get po -A should at least return the apiserver.

Please add an integration test that asserts here right after startup here:

{"KubeContext", validateKubeContext}, // Racy: must come immediately after "minikube start"

I suggest using validateKubeContext as a template to get started.

@tstromberg
Copy link
Contributor

Current integration tests appear to be unrelated flakes. Great work! =)

@priyawadhwa
Copy link
Author

priyawadhwa commented Oct 28, 2019

@tstromberg I check if we can get the apiserver pod here without error, do you think that's enough?

(It shouldn't return err==nil until the pod is up, but I don't check if the pod is Running)

to make sure apiserver is up and running and that the pod can be
accessed via kubectl.
Copy link
Contributor

@tstromberg tstromberg left a comment

Choose a reason for hiding this comment

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

This PR is awesome, and completely overdue.

cmd/minikube/cmd/start.go Outdated Show resolved Hide resolved
pkg/minikube/bootstrapper/kubeadm/kubeadm.go Show resolved Hide resolved
@tstromberg
Copy link
Contributor

tstromberg commented Oct 28, 2019

@tstromberg I check if we can get the apiserver pod here without error, do you think that's enough?

(It shouldn't return err==nil until the pod is up, but I don't check if the pod is Running)

Your PR is doing the right thing. The integration test is so that future contributors do not unknowingly change this behavior.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 29, 2019
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 29, 2019
@priyawadhwa
Copy link
Author

@tstromberg sounds good! I removed updating the docs from this PR, it was getting large/complicated and it'll be easier to review it in a separate PR.

Copy link
Contributor

@tstromberg tstromberg left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 29, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: priyawadhwa, tstromberg

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 Oct 29, 2019
@tstromberg tstromberg merged commit b4ce29d into kubernetes:master Oct 29, 2019
@priyawadhwa priyawadhwa deleted the wait_false branch January 14, 2020 22:30
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that 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