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

Stream kubeadm progress logs #9779

Closed
tstromberg opened this issue Nov 25, 2020 · 5 comments · Fixed by #9904
Closed

Stream kubeadm progress logs #9779

tstromberg opened this issue Nov 25, 2020 · 5 comments · Fixed by #9904
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@tstromberg
Copy link
Contributor

tstromberg commented Nov 25, 2020

At the moment, there can be 20-25 seconds with no updates via JSON. This can cause a bad user experience, as noted by folks using minikube in an embedded environment.

We at least used to stream the kubeadm output to glog, but we should also make it available via JSON.

@tstromberg tstromberg added kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Nov 25, 2020
@tstromberg
Copy link
Contributor Author

/cc @priyawadhwa

@medyagh
Copy link
Member

medyagh commented Nov 25, 2020

simmilar to #9091 (but not same)

@medyagh
Copy link
Member

medyagh commented Nov 25, 2020

however picks this task up this will require us to implement exec Command's Start for our Command Runner

here in the code we have
https://github.com/medyagh/minikube/blob/7bc81b1cbdae09aa2cdae46e377e4a8cc333f343/pkg/minikube/command/command_runner.go#L55

	c := exec.CommandContext(ctx, "/bin/bash", "-c", fmt.Sprintf("%s init --config %s %s --ignore-preflight-errors=%s",
		bsutil.InvokeKubeadm(cfg.KubernetesConfig.KubernetesVersion), conf, extraFlags, strings.Join(ignore, ",")))
	if _, err := k.c.RunCmd(c); err != nil {

https://github.com/medyagh/minikube/blob/7bc81b1cbdae09aa2cdae46e377e4a8cc333f343/pkg/minikube/bootstrapper/kubeadm/kubeadm.go#L229

which means we wait for command to Finish then we print the logs

but we can use golan'gs exec.Start()
and then wait for it

https://golang.org/pkg/os/exec/#Cmd.Start

This task might need us to add Start to our Own Command Runner Interface
which currently is



type Runner interface {
	// RunCmd runs a cmd of exec.Cmd type. allowing user to set cmd.Stdin, cmd.Stdout,...
	// not all implementors are guaranteed to handle all the properties of cmd.
	RunCmd(cmd *exec.Cmd) (*RunResult, error)

	// Copy is a convenience method that runs a command to copy a file
	Copy(assets.CopyableFile) error

	// Remove is a convenience method that runs a command to remove a file
	Remove(assets.CopyableFile) error
}

@medyagh
Copy link
Member

medyagh commented Dec 1, 2020

@spowelljr

@medyagh medyagh changed the title Stream kubeadm progress via JSON Stream kubeadm progress Dec 1, 2020
@medyagh medyagh changed the title Stream kubeadm progress Stream kubeadm progress logs Dec 1, 2020
@spowelljr
Copy link
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants