8000 Add kubectl desc nodes to minikube logs by prasadkatti · Pull Request #7105 · kubernetes/minikube · GitHub
[go: up one dir, main page]

Skip to content

Add kubectl desc nodes to minikube logs - #7105

Merged
tstromberg merged 8 commits into
kubernetes:masterfrom
prasadkatti:add_desc_node_to_minikube_logs
Mar 21, 2020
Merged

tstromberg merged 8 commits into
kubernetes:masterfrom
prasadkatti:add_desc_node_to_minikube_logs

Conversation

@prasadkatti
Copy link
Copy Markdown
Contributor

fixes #7092

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

Hi @prasadkatti. 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.

Details

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 18, 2020
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found here.

Details 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
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@prasadkatti
Copy link
Copy Markdown
Contributor Author

/assign @priyawadhwa

Hi @priyawadhwa. I am a newbie at go and minikube. If there are any error handling or source code formatting issues, please let me know.

@codecov-io
codecov-io commented Mar 18, 2020 •
Copy link
Copy Markdown

Codecov Report

Merging #7105 into master will not change coverage by %.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7105   +/-   ##
=======================================
  Coverage   37.12%   37.12%           
=======================================
  Files         146      146           
  Lines        9124     9124           
=======================================
  Hits         3387     3387           
  Misses       5321     5321           
  Partials      416      416           
Impacted Files Coverage Δ
cmd/minikube/cmd/logs.go 10.86% <0.00%> (ø)
pkg/minikube/bootstrapper/bootstrapper.go 0.00% <ø> (ø)
pkg/minikube/logs/logs.go 2.35% <0.00%> (ø)

@priyawadhwa
Copy link
Copy Markdown

/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 Mar 19, 2020
@minikube-pr-bot
Copy link
Copy Markdown

Error: running mkcmp: exit status 1

Comment thread pkg/minikube/logs/logs.go Outdated
cmds["container status"] = cruntime.ContainerStatusCommand()

cfg, err := config.Load(viper.GetString(config.ProfileName))
if err != nil && !config.IsNotExist(err) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can just say

if err != nil

here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

okay, thanks for the review! Are the failing checks unrelated to my changes? I couldn't really tell.

@minikube-pr-bot
Copy link
Copy Markdown

All Times minikube: [ 70.045328 73.533552 72.477204]
All Times Minikube (PR 7105): [ 72.702375 73.201969 73.453014]

Average minikube: 72.018694
Average Minikube (PR 7105): 73.119119

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 7105) |
+----------------------+-----------+--------------------+
| minikube v           |  0.261973 |           0.248090 |
| Creating kvm2        | 45.920534 |          46.018552 |
| Preparing Kubernetes |  0.904961 |           0.906296 |
| Pulling images       |           |                    |
| Launching Kubernetes | 22.601833 |          23.674541 |
| Waiting for cluster  |  0.439471 |           0.109773 |
+----------------------+-----------+--------------------+

Comment thread pkg/minikube/logs/logs.go Outdated
cmds[r.Name()] = r.SystemLogCmd(length)
cmds["container status"] = cruntime.ContainerStatusCommand()

cfg, err := config.Load(viper.GetString(config.ProfileName))
@tstromberg tstromberg Mar 20, 2020 •
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nicely done! Thank you!

So, the frustrating part is that the configuration for this profile is already loaded, but the logs package does not have access to it. If it isn't too much trouble on your part, can you help us get that addressed? It'll be cleaner and faster that way.

I know I said differently in the issue, but lets start by moving this addition to the kubeadm bootstrapper, since it's the only one that guarantees where the kubelet is installed. Start my moving your code here:

func (k *Bootstrapper) LogCommands(o bootstrapper.LogOptions) map[string]string {

Now, to plumb in our missing loaded configuration (config.ClusterConfig). First pass the cfg variable to logs.Output:

err = logs.Output(cr, bs, runner, numberOfLines)

Then logs.logCommands, where we are now:

cmds := logCommands(r, bs, lines, false)

Then to bs.LogCommands (effectively kubeadm.LogCommands), which handles bootstrapper specific logs:

cmds := bs.LogCommands(bootstrapper.LogOptions{Lines: length, Follow: follow})

One tip: Some packages name the config.ClusterConfig variable as cfg, some name it cc. Use whichever nomenclature you find in the package, which I believe will usually be cfg in this part of the code base.

If this is all too much, please let me know. Thank you again! The code looks great otherwise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can definitely try. If I need help along the way, I will ask on the slack channel.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 20, 2020
@minikube-pr-bot
Copy link
Copy Markdown

All Times minikube: [ 68.167756 69.435963 64.223079]
All Times Minikube (PR 7105): [ 63.560245 63.536464 68.230130]

Average minikube: 67.275599
Average Minikube (PR 7105): 65.108946

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 7105) |
+----------------------+-----------+--------------------+
| minikube v           |  0.217418 |           0.214019 |
| Creating kvm2        | 43.281157 |          42.415408 |
| Preparing Kubernetes |  0.743551 |           0.745798 |
| Pulling images       |           |                    |
| Launching Kubernetes | 20.878489 |          19.896172 |
| Waiting for cluster  |  0.398720 |           0.233759 |
+----------------------+-----------+--------------------+

@minikube-pr-bot
Copy link
Copy Markdown

All Times minikube: [ 68.277951 66.968466 65.261791]
All Times Minikube (PR 7105): [ 61.692418 65.943892 64.247131]

Average minikube: 66.836069
Average Minikube (PR 7105): 63.961147

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 7105) |
+----------------------+-----------+--------------------+
| minikube v           |  0.221126 |           0.206042 |
| Creating kvm2        | 42.923513 |          41.312698 |
| Preparing Kubernetes |  0.749826 |           0.735914 |
| Pulling images       |           |                    |
| Launching Kubernetes | 20.841427 |          19.516512 |
| Waiting for cluster  |  0.402799 |           0.561161 |
+----------------------+-----------+--------------------+

@minikube-pr-bot
Copy link
Copy Markdown

All Times minikube: [ 67.952134 63.561334 64.747868]
All Times Minikube (PR 7105): [ 64.043165 64.311696 67.609506]

Average minikube: 65.420445
Average Minikube (PR 7105): 65.321456

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 7105) |
+----------------------+-----------+--------------------+
| minikube v           |  0.243852 |           0.211874 |
| Creating kvm2        | 42.443723 |          41.885994 |
| Preparing Kubernetes | 20.849254 |           0.744920 |
| Pulling images       |           |                    |
| Launching Kubernetes |           |          20.275756 |
| Waiting for cluster  |  0.238035 |           0.565157 |
+----------------------+-----------+--------------------+

@tstromberg
Copy link
Copy Markdown
Contributor

make test shows:

pkg/minikube/node/start.go:115:72: not enough arguments in call to logs.FindProblems
	have (cruntime.Manager, bootstrapper.Bootstrapper, command.Runner)
	want (cruntime.Manager, bootstrapper.Bootstrapper, "k8s.io/minikube/pkg/minikube/config".ClusterConfig, logs.logRunner)

Need any help with this PR?

@prasadkatti
Copy link
Copy Markdown
Contributor Author

No, I think I am good for now. The multi-node PR was merged which has created some merge conflicts. I am trying to resolve those conflicts. I will reach out for help if I get stuck. Thanks! :)

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 21, 2020
@minikube-pr-bot
Copy link
Copy Markdown

All Times Minikube (PR 7105): [ 69.496254 70.614402 71.053381]
All Times minikube: [ 70.516323 68.219146 70.147858]

Average minikube: 69.627776
Average Minikube (PR 7105): 70.388013

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 7105) |
+----------------------+-----------+--------------------+
| minikube v           |  0.252745 |           0.224114 |
| Creating kvm2        | 43.444403 |          44.790834 |
| Preparing Kubernetes | 23.705339 |           0.858089 |
| Pulling images       |           |                    |
| Launching Kubernetes |           |          22.211336 |
| Waiting for cluster  |           |           0.426548 |
+----------------------+-----------+--------------------+

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 21, 2020
@prasadkatti
prasadkatti requested a review from tstromberg March 21, 2020 20:01
@tstromberg
Copy link
Copy Markdown
Contributor

Looks great. Thank you!

@tstromberg
tstromberg merged commit cf887e7 into kubernetes:master Mar 21, 2020
@prasadkatti
Copy link
Copy Markdown
Contributor Author

Thank you for your help!

@codecov-commenter
codecov-commenter commented Apr 2, 2026 •
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.02%. Comparing base (ba4e993) to head (376271a).
⚠️ Report is 18840 commits behind head on master.

Files with missing lines Patch % Lines
pkg/minikube/logs/logs.go 0.00% 8 Missing ⚠️
cmd/minikube/cmd/logs.go 0.00% 3 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7105   +/-   ##
=======================================
  Coverage   37.02%   37.02%           
=======================================
  Files         145      145           
  Lines        9219     9219           
=======================================
  Hits         3413     3413           
  Misses       5383     5383           
  Partials      423      423           
Files with missing lines Coverage Δ
pkg/minikube/bootstrapper/bootstrapper.go 0.00% <ø> (ø)
cmd/minikube/cmd/logs.go 10.86% <0.00%> (ø)
pkg/minikube/logs/logs.go 2.35% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Add kubectl desc node -A to minikube logs command

8 participants

0