diff --git a/pkg/minikube/bootstrapper/bsutil/kverify/system_pods.go b/pkg/minikube/bootstrapper/bsutil/kverify/system_pods.go index 7da7512312db..67316f1010c8 100644 --- a/pkg/minikube/bootstrapper/bsutil/kverify/system_pods.go +++ b/pkg/minikube/bootstrapper/bsutil/kverify/system_pods.go @@ -77,6 +77,7 @@ func WaitForSystemPods(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg con // ExpectAppsRunning returns whether or not all expected k8s-apps are running. (without waiting for them) func ExpectAppsRunning(cs *kubernetes.Clientset, expected []string) error { + found := map[string]bool{} pods, err := cs.CoreV1().Pods("kube-system").List(context.Background(), meta.ListOptions{}) @@ -85,12 +86,30 @@ func ExpectAppsRunning(cs *kubernetes.Clientset, expected []string) error { } klog.Infof("%d kube-system pods found", len(pods.Items)) + for { + // core dns deployment has been scaled to 1 pods, wait until there is only 1 pod + corednsPods, err := cs.CoreV1().Pods("kube-system").List(context.Background(), meta.ListOptions{ + LabelSelector: "k8s-app=kube-dns", + }) + if err != nil { + return err + } + if len(corednsPods.Items) == 1 { + break + } + } + for _, pod := range pods.Items { klog.Info(podStatusMsg(pod)) if pod.Status.Phase != core.PodRunning { continue } + for _, cs := range pod.Status.ContainerStatuses { + if !cs.Ready { + continue + } + } for k, v := range pod.ObjectMeta.Labels { if k == "component" || k == "k8s-app" {