From 9ca9242320fb650343629d057e5773b2069ec8ca Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 21 Dec 2018 11:49:14 -0800 Subject: [PATCH 1/6] Disable dashboard by default --- pkg/minikube/assets/addons.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index 825de3b8e5bd..62dbde316178 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -74,7 +74,7 @@ var Addons = map[string]*Addon{ constants.AddonsPath, "dashboard-svc.yaml", "0640"), - }, true, "dashboard"), + }, false, "dashboard"), "default-storageclass": NewAddon([]*BinDataAsset{ NewBinDataAsset( "deploy/addons/storageclass/storageclass.yaml", From dba0c0a0dc9bc07e6c60174d89388b6ab18ce117 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 21 Dec 2018 11:49:20 -0800 Subject: [PATCH 2/6] Disable dashboard by default --- cmd/minikube/cmd/dashboard.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/dashboard.go b/cmd/minikube/cmd/dashboard.go index 0ba4f30b815c..098f1b26ae0a 100644 --- a/cmd/minikube/cmd/dashboard.go +++ b/cmd/minikube/cmd/dashboard.go @@ -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,6 +65,13 @@ var dashboardCmd = &cobra.Command{ } cluster.EnsureMinikubeRunningOrExit(api, 1) + // Enable the dashboard add-on + err = configcmd.Set("dashboard", "true") + if err != nil { + fmt.Fprintf(os.Stdout, "Unable to enable dashboard: %v", 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 { From f3d158198f6c7b9571a625c968c93a6ad259bba6 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 21 Dec 2018 12:00:43 -0800 Subject: [PATCH 3/6] Add helpful dashboard status messages to stderr --- cmd/minikube/cmd/dashboard.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/dashboard.go b/cmd/minikube/cmd/dashboard.go index 098f1b26ae0a..dd1ce4538a9c 100644 --- a/cmd/minikube/cmd/dashboard.go +++ b/cmd/minikube/cmd/dashboard.go @@ -65,26 +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.Stdout, "Unable to enable dashboard: %v", err) + fmt.Fprintf(os.Stderr, "Unable to enable dashboard: %v\n", err) os.Exit(1) } ns := "kube-system" svc := "kubernetes-dashboard" + fmt.Fprintln(os.Stderr, "Verifying dashboard health ...") if err = util.RetryAfter(30, func() error { return service.CheckService(ns, svc) }, 1*time.Second); err != nil { fmt.Fprintf(os.Stderr, "%s:%s is not running: %v\n", ns, svc, err) os.Exit(1) } + fmt.Fprintln(os.Stderr, "Launching proxy ...") 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 ...") 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) From 44a230bfa0e742255b8b830a21fe372d0674fd90 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 21 Dec 2018 12:03:15 -0800 Subject: [PATCH 4/6] Remove dashboard deployment check from TestPersistence - it's no longer default --- test/integration/persistence_test.go | 4 ---- test/integration/util/util.go | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/test/integration/persistence_test.go b/test/integration/persistence_test.go index 5f048c8b2f8a..0d889ee9dd9e 100644 --- a/test/integration/persistence_test.go +++ b/test/integration/persistence_test.go @@ -44,10 +44,6 @@ func TestPersistence(t *testing.T) { } verify := func(t *testing.T) { - if err := util.WaitForDashboardRunning(t); err != nil { - t.Fatalf("waiting for dashboard to be up: %v", err) - } - if err := util.WaitForBusyboxRunning(t, "default"); err != nil { t.Fatalf("waiting for busybox to be up: %v", err) } diff --git a/test/integration/util/util.go b/test/integration/util/util.go index 7a4c11d77072..74cee504d002 100644 --- a/test/integration/util/util.go +++ b/test/integration/util/util.go @@ -295,18 +295,6 @@ func WaitForBusyboxRunning(t *testing.T, namespace string) error { return commonutil.WaitForPodsWithLabelRunning(client, namespace, selector) } -func WaitForDashboardRunning(t *testing.T) error { - client, err := commonutil.GetClient() - if err != nil { - return errors.Wrap(err, "getting kubernetes client") - } - if err := commonutil.WaitForDeploymentToStabilize(client, "kube-system", "kubernetes-dashboard", time.Minute*10); err != nil { - return errors.Wrap(err, "waiting for dashboard deployment to stabilize") - } - - return nil -} - func WaitForIngressControllerRunning(t *testing.T) error { client, err := commonutil.GetClient() if err != nil { From 6f5c380ff6368bf6594174a805eabe6d66e09392 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 21 Dec 2018 13:07:49 -0800 Subject: [PATCH 5/6] RunDaemon: tee stderr for debugging --- test/integration/util/util.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/integration/util/util.go b/test/integration/util/util.go index 74cee504d002..e854202a0009 100644 --- a/test/integration/util/util.go +++ b/test/integration/util/util.go @@ -65,7 +65,7 @@ func (m *MinikubeRunner) Run(cmd string) error { func (m *MinikubeRunner) Copy(f assets.CopyableFile) error { path, _ := filepath.Abs(m.BinaryPath) cmd := exec.Command("/bin/bash", "-c", path, "ssh", "--", fmt.Sprintf("cat >> %s", filepath.Join(f.GetTargetDir(), f.GetTargetName()))) - Logf("Running: %s", cmd) + Logf("Running: %s", cmd.Args) return cmd.Run() } @@ -144,6 +144,17 @@ func (m *MinikubeRunner) RunDaemon(command string) (*exec.Cmd, *bufio.Reader) { if err != nil { m.T.Fatalf("stdout pipe failed: %s %v", command, err) } + stderrPipe, err := cmd.StderrPipe() + if err != nil { + m.T.Fatalf("stderr pipe failed: %s %v", command, err) + } + + var errB bytes.Buffer + go func() { + if err := commonutil.TeePrefix(commonutil.ErrPrefix, stderrPipe, &errB, Logf); err != nil { + m.T.Logf("tee: %v", err) + } + }() err = cmd.Start() if err != nil { From 1bd4b05bc854ec70e74898a4caae48d783df5075 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 21 Dec 2018 14:14:36 -0800 Subject: [PATCH 6/6] Increase dashboard retry time from 30 seconds to 3 minutes --- cmd/minikube/cmd/dashboard.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/dashboard.go b/cmd/minikube/cmd/dashboard.go index dd1ce4538a9c..e4c75d361b32 100644 --- a/cmd/minikube/cmd/dashboard.go +++ b/cmd/minikube/cmd/dashboard.go @@ -76,7 +76,7 @@ var dashboardCmd = &cobra.Command{ ns := "kube-system" svc := "kubernetes-dashboard" fmt.Fprintln(os.Stderr, "Verifying dashboard health ...") - if err = util.RetryAfter(30, func() error { return service.CheckService(ns, svc) }, 1*time.Second); err != nil { + if err = util.RetryAfter(180, func() error { return service.CheckService(ns, svc) }, 1*time.Second); err != nil { fmt.Fprintf(os.Stderr, "%s:%s is not running: %v\n", ns, svc, err) os.Exit(1) }