-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Defer dashboard deployment until "minikube dashboard" is executed #3485
Changes from all commits
9ca9242
dba0c0a
f3d1581
44a230b
6f5c380
1bd4b05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,11 +30,11 @@ import ( | |||||
"github.com/pkg/browser" | ||||||
"github.com/pkg/errors" | ||||||
"github.com/spf13/cobra" | ||||||
configcmd "k8s.io/minikube/cmd/minikube/cmd/config" | ||||||
"k8s.io/minikube/pkg/minikube/cluster" | ||||||
"k8s.io/minikube/pkg/minikube/config" | ||||||
"k8s.io/minikube/pkg/minikube/machine" | ||||||
"k8s.io/minikube/pkg/minikube/service" | ||||||
|
||||||
"k8s.io/minikube/pkg/util" | ||||||
) | ||||||
|
||||||
|
@@ -65,19 +65,30 @@ var dashboardCmd = &cobra.Command{ | |||||
} | ||||||
cluster.EnsureMinikubeRunningOrExit(api, 1) | ||||||
|
||||||
fmt.Fprintln(os.Stderr, "Enabling dashboard ...") | ||||||
// Enable the dashboard add-on | ||||||
err = configcmd.Set("dashboard", "true") | ||||||
if err != nil { | ||||||
fmt.Fprintf(os.Stderr, "Unable to enable dashboard: %v\n", err) | ||||||
os.Exit(1) | ||||||
} | ||||||
|
||||||
ns := "kube-system" | ||||||
svc := "kubernetes-dashboard" | ||||||
if err = util.RetryAfter(30, func() error { return service.CheckService(ns, svc) }, 1*time.Second); err != nil { | ||||||
fmt.Fprintln(os.Stderr, "Verifying dashboard health ...") | ||||||
if err = util.RetryAfter(180, func() error { return service.CheckService(ns, svc) }, 1*time.Second); err != nil { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be interesting to keep a "watch" on the dashboard pod + on a separate line the result of the service status? But this idea might be better off in a separate PR. It's just 3 minutes of potential waiting is definitely long. Out of those 1 minute is almost guaranteed to be just the addon-manager kicking in... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A good idea, but due to the complexity l will leave this for another PR. This step generally only takes a second or two, but to avoid flakes in places with poor connectivity, I wanted to make sure to wait an extended period for the pod to come up. |
||||||
fmt.Fprintf(os.Stderr, "%s:%s is not running: %v\n", ns, svc, err) | ||||||
os.Exit(1) | ||||||
} | ||||||
|
||||||
fmt.Fprintln(os.Stderr, "Launching proxy ...") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
p, hostPort, err := kubectlProxy() | ||||||
if err != nil { | ||||||
glog.Fatalf("kubectl proxy: %v", err) | ||||||
} | ||||||
url := dashboardURL(hostPort, ns, svc) | ||||||
|
||||||
fmt.Fprintln(os.Stderr, "Verifying proxy health ...") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if err = util.RetryAfter(60, func() error { return checkURL(url) }, 1*time.Second); err != nil { | ||||||
fmt.Fprintf(os.Stderr, "%s is not responding properly: %v\n", url, err) | ||||||
os.Exit(1) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this idempontent? If yes, then we don't need "Enabling dashboard ..." the second time (I think addons enable is idempotent) - would be nice to check for enablement.