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

Repair kubecontext before checking cluster health #9143

Merged
merged 1 commit into from
Sep 2, 2020

Conversation

tstromberg
Copy link
Contributor

This fixes this ugly error noticed by @MarlonGamez and myself:

🤦 Unable to restart cluster, will reset it: getting k8s client: client config: client config: context "minikube" does not exist

With this PR, we no longer unnecessarily call kubeadm reset if the only thing wrong with the cluster is a missing kube config entry. This reduces restart time from 73.83s to 5.4s in this particular scenario:

minikube start && sleep 30 && rm $HOME/.kube/config && minikube start

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 1, 2020
@tstromberg tstromberg requested review from medyagh and sharifelgamal and removed request for josedonizetti September 1, 2020 14:00
@tstromberg tstromberg changed the title Repair missing/invalid kubecontext before checking cluster health Repair kubecontext before checking cluster health Sep 1, 2020
@tstromberg
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Sep 1, 2020
@kubernetes kubernetes deleted a comment from minikube-pr-bot Sep 1, 2020
@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: 64.8s 66.4s 67.0s
Average time for minikube: 66.0s

Times for Minikube (PR 9143): 66.1s 64.6s 65.8s
Average time for Minikube (PR 9143): 65.5s

Averages Time Per Log

+--------------------------------+----------+--------------------+
|              LOG               | MINIKUBE | MINIKUBE (PR 9143) |
+--------------------------------+----------+--------------------+
| * minikube v1.12.3 on Debian   | 0.1s     | 0.1s               |
|                           9.11 |          |                    |
| * Using the kvm2 driver based  | 0.0s     | 0.0s               |
| on user configuration          |          |                    |
| * Starting control plane node  | 0.0s     | 0.0s               |
| minikube in cluster minikube   |          |                    |
| * Creating kvm2 VM (CPUs=2,    | 39.9s    | 40.0s              |
| Memory=3700MB, Disk=20000MB)   |          |                    |
| ...                            |          |                    |
| * Preparing Kubernetes v1.19.0 | 23.8s    | 23.5s              |
| on Docker 19.03.12 ...         |          |                    |
| * Verifying Kubernetes         | 1.6s     | 1.6s               |
| components...                  |          |                    |
| * Enabled addons:              | 0.5s     | 0.2s               |
| default-storageclass,          |          |                    |
| storage-provisioner            |          |                    |
| * Done! kubectl is now         | 0.1s     | 0.1s               |
| configured to use "minikube"   |          |                    |
|                                | 0.0s     | 0.0s               |
+--------------------------------+----------+--------------------+

docker Driver
Times for minikube: 30.3s 29.9s 29.3s
Average time for minikube: 29.8s

Times for Minikube (PR 9143): 28.3s 28.6s 29.7s
Average time for Minikube (PR 9143): 28.9s

Averages Time Per Log

+--------------------------------+----------+--------------------+
|              LOG               | MINIKUBE | MINIKUBE (PR 9143) |
+--------------------------------+----------+--------------------+
| * minikube v1.12.3 on Debian   | 0.1s     | 0.1s               |
|                           9.11 |          |                    |
| * Using the docker driver      | 0.0s     | 0.0s               |
| based on user configuration    |          |                    |
|                                | 0.0s     | 19.0s              |
|                                |          |                    |
| * Starting control plane node  |          |                    |
| minikube in cluster minikube   |          |                    |
| * Creating docker container    |          |                    |
| (CPUs=2, Memory=3700MB) ...    |          |                    |
| * Preparing Kubernetes v1.19.0 |          |                    |
| on Docker 19.03.8 ...          |          |                    |
| * Verifying Kubernetes         |          |                    |
| components...                  |          |                    |
| * Enabled addons:              |          |                    |
| default-storageclass,          |          |                    |
| storage-provisioner            |          |                    |
| * Done! kubectl is now         |          |                    |
| configured to use "minikube"   |          |                    |
|                                |          |                    |
+--------------------------------+----------+--------------------+

Copy link

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

Nice!

@tstromberg tstromberg merged commit e377444 into kubernetes:master Sep 2, 2020
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants