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

Wait for control plane node to be ready after joining the cluster #598

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 11 additions & 0 deletions pkg/cluster/internal/create/actions/kubeadmjoin/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"path"
"path/filepath"
"strings"
"time"

"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -211,6 +212,16 @@ func runKubeadmJoinControlPlane(
return errors.Wrap(err, "failed to join a control plane node with kubeadm")
}

// Wait for the node to be Ready
// TODO: remove once https://github.com/kubernetes-sigs/kind/issues/588 is fixed
// kubeadm join should guarantee that the cluster is ready
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabriziopandini @neolit123 I don't know if this is true 😅 , should kubeadm join, guarantee that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aojea see my comments on the issue #588 (comment)

In a nutshell Kubeadm is not responsible, but it is the kubelet. Additional, it seems also that the API server does not detected properly when the etcd instance is ready

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubeadm join should guarantee that the cluster is ready

well kubeadm can look at pod and endpoint state, but the cluster as a whole - a bit tricky.
kinder currently waits for these pods + the node ready status, as @fabriziopandini mentioned:
https://github.com/kubernetes/kubeadm/blob/62556834c87e34004ac84c17b2f2c68b5c4f3b22/kinder/pkg/actions/waiter.go#L32-L44

given HA join consistently does not fail using kind 0.2.0 as seen here:
https://k8s-testgrid.appspot.com/sig-cluster-lifecycle-kubeadm#kubeadm-kind-master
i'm trying to get to the bottom of the problem instead - i.e. finding a change in kind that helped the problem surface.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind is much faster with the latest versions, the fact that adding delays solve the problem or at least reduce them makes me think that´s tightly related to that

startTime := time.Now()
// TODO: currently hardcoded to 10s
isReady := nodes.WaitForReady(node, startTime.Add(10*time.Second))
aojea marked this conversation as resolved.
Show resolved Hide resolved
if !isReady {
return errors.Errorf("Timed out waiting for control plane node %s to be ready after join", node.String())
}

return nil
}

Expand Down