@@ -626,9 +626,16 @@ func installAndStartCluster(ctx context.Context, networkInterface string, airgap
626626 if err := k0s .Install (networkInterface ); err != nil {
627627 return nil , fmt .Errorf ("install cluster: %w" , err )
628628 }
629+
629630 loading .Infof ("Waiting for %s node to be ready" , runtimeconfig .BinaryName ())
631+
630632 logrus .Debugf ("waiting for k0s to be ready" )
631633 if err := waitForK0s (); err != nil {
634+ return nil , fmt .Errorf ("wait for k0s: %w" , err )
635+ }
636+
637+ logrus .Debugf ("waiting for node to be ready" )
638+ if err := waitForNode (ctx ); err != nil {
632639 return nil , fmt .Errorf ("wait for node: %w" , err )
633640 }
634641
@@ -947,6 +954,21 @@ func waitForK0s() error {
947954 }
948955}
949956
957+ func waitForNode (ctx context.Context ) error {
958+ kcli , err := kubeutils .KubeClient ()
959+ if err != nil {
960+ return fmt .Errorf ("create kube client: %w" , err )
961+ }
962+ hostname , err := os .Hostname ()
963+ if err != nil {
964+ return fmt .Errorf ("get hostname: %w" , err )
965+ }
966+ if err := kubeutils .WaitForControllerNode (ctx , kcli , hostname ); err != nil {
967+ return fmt .Errorf ("wait for node: %w" , err )
968+ }
969+ return nil
970+ }
971+
950972func recordInstallation (ctx context.Context , kcli client.Client , flags InstallCmdFlags , k0sCfg * k0sv1beta1.ClusterConfig , disasterRecoveryEnabled bool ) (* ecv1beta1.Installation , error ) {
951973 // ensure that the embedded-cluster namespace exists
952974 if err := createECNamespace (ctx , kcli ); err != nil {
0 commit comments