k3d icon indicating copy to clipboard operation
k3d copied to clipboard

[BUG] waiting for k3s is not sufficient

Open k0da opened this issue 5 years ago • 1 comments

since 4.1.0 k3d waits for k3s to finish startup, but for k8s this is not sufficient as Node is not Ready yet.

IMO k3d should wait for kubelet to be started ("kubelet started" message).

What did you do

  • How was the cluster created?

    • k3d cluster create foo --wait
  • What did you do afterwards?

  • kubectl get no

What did you expect to happen

Node is Ready

Screenshots or terminal output

k3d cluster create foo --wait; kubectl get no
INFO[0000] Prep: Network
INFO[0000] Created network 'k3d-foo'
INFO[0000] Created volume 'k3d-foo-images'
INFO[0001] Creating node 'k3d-foo-server-0'
INFO[0001] Creating LoadBalancer 'k3d-foo-serverlb'
INFO[0001] Starting cluster 'foo'
INFO[0001] Starting servers...
INFO[0001] Starting Node 'k3d-foo-server-0'
INFO[0007] Starting agents...
INFO[0007] Starting helpers...
INFO[0007] Starting Node 'k3d-foo-serverlb'
INFO[0009] (Optional) Trying to get IP of the docker host and inject it into the cluster as 'host.k3d.internal' for easy access
INFO[0011] Successfully added host record to /etc/hosts in 2/2 nodes and to the CoreDNS ConfigMap
INFO[0011] Cluster 'foo' created successfully!
INFO[0011] --kubeconfig-update-default=false --> sets --kubeconfig-switch-context=false
INFO[0011] You can now use it like this:
kubectl config use-context k3d-foo
kubectl cluster-info
NAME               STATUS     ROLES                  AGE   VERSION
k3d-foo-server-0   NotReady   control-plane,master   5s    v1.20.2+k3s1

Which OS & Architecture

  • MacOS

Which version of k3d

  • k3d version v4.2.0 k3s version latest (default)

Which version of docker

  • output of docker version and docker info 20.10.2

k0da avatar Feb 24 '21 11:02 k0da

Hi @k0da , k3s waits for as long as it takes for the API-Server to be up and running, i.e. making the cluster responsive for further usage. Basically, then the cluster can be used with kubectl already to modify it in early stages. In a first test though it seems like there are just a few seconds between those two log lines (around 3 seconds in my case). The log lines we could alternatively wait for are Started kubelet or even Successfully registered node.

iwilltry42 avatar Mar 02 '21 17:03 iwilltry42