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

Do not wait for k8s-app pods when starting with CNI #3896

Merged
merged 1 commit into from
Mar 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions pkg/minikube/bootstrapper/kubeadm/kubeadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (k *KubeadmBootstrapper) StartCluster(k8s config.KubernetesConfig) error {
}
}

if err := waitForPods(false); err != nil {
if err := waitForPods(k8s, false); err != nil {
return errors.Wrap(err, "wait")
}

Expand All @@ -204,7 +204,7 @@ func (k *KubeadmBootstrapper) StartCluster(k8s config.KubernetesConfig) error {
}

// Make sure elevating privileges didn't screw anything up
if err := waitForPods(true); err != nil {
if err := waitForPods(k8s, true); err != nil {
return errors.Wrap(err, "wait")
}

Expand Down Expand Up @@ -232,7 +232,12 @@ func addAddons(files *[]assets.CopyableFile) error {
}

// waitForPods waits until the important Kubernetes pods are in running state
func waitForPods(quiet bool) error {
func waitForPods(k8s config.KubernetesConfig, quiet bool) error {
// Do not wait for "k8s-app" pods in the case of CNI, as they are managed
// by a CNI plugin which is usually started after minikube has been brought
// up. Otherwise, minikube won't start, as "k8s-app" pods are not ready.
componentsOnly := k8s.NetworkPlugin == "cni"

if !quiet {
console.OutStyle("waiting-pods", "Waiting for pods:")
}
Expand All @@ -242,6 +247,10 @@ func waitForPods(quiet bool) error {
}

for _, p := range PodsByLayer {
if componentsOnly && p.key != "component" {
continue
}

if !quiet {
console.Out(" %s", p.name)
}
Expand Down Expand Up @@ -284,7 +293,7 @@ func (k *KubeadmBootstrapper) RestartCluster(k8s config.KubernetesConfig) error
}
}

if err := waitForPods(false); err != nil {
if err := waitForPods(k8s, false); err != nil {
return errors.Wrap(err, "wait")
}

Expand All @@ -294,7 +303,7 @@ func (k *KubeadmBootstrapper) RestartCluster(k8s config.KubernetesConfig) error
}

// Make sure the kube-proxy restart didn't screw anything up.
if err := waitForPods(true); err != nil {
if err := waitForPods(k8s, true); err != nil {
return errors.Wrap(err, "wait")
}

Expand Down