diff --git a/providers/aws/create.go b/providers/aws/create.go index af05a56f..6dd6c5c5 100644 --- a/providers/aws/create.go +++ b/providers/aws/create.go @@ -213,29 +213,29 @@ func CreateAWSCluster(definition *pkgtypes.ClusterDefinition) error { return err } - // Wait for console Deployment Pods to transition to Running - log.Info("deploying kubefirst console and verifying cluster installation is complete") - consoleDeployment, err := k8s.ReturnDeploymentObject( + // Wait for last sync wave app transition to Running + log.Info("waiting for final sync wave Deployment to transition to Running") + crossplaneDeployment, err := k8s.ReturnDeploymentObject( kcfg.Clientset, - "app.kubernetes.io/name", - "console", - "kubefirst", + "app.kubernetes.io/instance", + "crossplane", + "crossplane-system", 1200, ) if err != nil { - log.Errorf("Error finding console Deployment: %s", err) - + log.Errorf("Error finding kubefirst api Deployment: %s", err) ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, consoleDeployment, 120) + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) if err != nil { - log.Errorf("Error waiting for console Deployment ready state: %s", err) + log.Errorf("Error waiting for all Apps to sync ready state: %s", err) ctrl.HandleError(err.Error()) return err } + log.Info("cluster creation complete") //* export and import cluster @@ -266,5 +266,28 @@ func CreateAWSCluster(definition *pkgtypes.ClusterDefinition) error { } } + log.Info("waiting for kubefirst-api Deployment to transition to Running") + kubefirstAPI, err := k8s.ReturnDeploymentObject( + kcfg.Clientset, + "app.kubernetes.io/name", + "kubefirst-api", + "kubefirst", + 1200, + ) + if err != nil { + log.Errorf("Error finding kubefirst api Deployment: %s", err) + ctrl.HandleError(err.Error()) + return err + } + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300) + if err != nil { + log.Errorf("Error waiting for kubefirst-api to transition to Running: %s", err) + + ctrl.HandleError(err.Error()) + return err + } + + log.Info("cluster creation complete") + return nil } diff --git a/providers/civo/create.go b/providers/civo/create.go index ced69892..c65d7804 100644 --- a/providers/civo/create.go +++ b/providers/civo/create.go @@ -189,8 +189,8 @@ func CreateCivoCluster(definition *pkgtypes.ClusterDefinition) error { return err } - // Wait for console Deployment Pods to transition to Running - log.Info("deploying kubefirst console and verifying cluster installation is complete") + // Wait for last sync wave app transition to Running + log.Info("waiting for final sync wave Deployment to transition to Running") crossplaneDeployment, err := k8s.ReturnDeploymentObject( kcfg.Clientset, "app.kubernetes.io/instance", @@ -203,7 +203,7 @@ func CreateCivoCluster(definition *pkgtypes.ClusterDefinition) error { ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 120) + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) if err != nil { log.Errorf("Error waiting for all Apps to sync ready state: %s", err) @@ -246,5 +246,28 @@ func CreateCivoCluster(definition *pkgtypes.ClusterDefinition) error { } } + log.Info("waiting for kubefirst-api Deployment to transition to Running") + kubefirstAPI, err := k8s.ReturnDeploymentObject( + kcfg.Clientset, + "app.kubernetes.io/name", + "kubefirst-api", + "kubefirst", + 1200, + ) + if err != nil { + log.Errorf("Error finding kubefirst api Deployment: %s", err) + ctrl.HandleError(err.Error()) + return err + } + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300) + if err != nil { + log.Errorf("Error waiting for kubefirst-api to transition to Running: %s", err) + + ctrl.HandleError(err.Error()) + return err + } + + log.Info("cluster creation complete") + return nil } diff --git a/providers/digitalocean/create.go b/providers/digitalocean/create.go index 10b45964..1864ec3e 100644 --- a/providers/digitalocean/create.go +++ b/providers/digitalocean/create.go @@ -186,24 +186,23 @@ func CreateDigitaloceanCluster(definition *pkgtypes.ClusterDefinition) error { return err } - // Wait for console Deployment Pods to transition to Running - log.Info("deploying kubefirst console and verifying cluster installation is complete") - consoleDeployment, err := k8s.ReturnDeploymentObject( + // Wait for last sync wave app transition to Running + log.Info("waiting for final sync wave Deployment to transition to Running") + crossplaneDeployment, err := k8s.ReturnDeploymentObject( kcfg.Clientset, - "app.kubernetes.io/name", - "console", - "kubefirst", + "app.kubernetes.io/instance", + "crossplane", + "crossplane-system", 1200, ) if err != nil { - log.Errorf("Error finding console Deployment: %s", err) - + log.Errorf("Error finding kubefirst api Deployment: %s", err) ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, consoleDeployment, 120) + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) if err != nil { - log.Errorf("Error waiting for console Deployment ready state: %s", err) + log.Errorf("Error waiting for all Apps to sync ready state: %s", err) ctrl.HandleError(err.Error()) return err @@ -241,5 +240,28 @@ func CreateDigitaloceanCluster(definition *pkgtypes.ClusterDefinition) error { } } + log.Info("waiting for kubefirst-api Deployment to transition to Running") + kubefirstAPI, err := k8s.ReturnDeploymentObject( + kcfg.Clientset, + "app.kubernetes.io/name", + "kubefirst-api", + "kubefirst", + 1200, + ) + if err != nil { + log.Errorf("Error finding kubefirst api Deployment: %s", err) + ctrl.HandleError(err.Error()) + return err + } + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300) + if err != nil { + log.Errorf("Error waiting for kubefirst-api to transition to Running: %s", err) + + ctrl.HandleError(err.Error()) + return err + } + + log.Info("cluster creation complete") + return nil } diff --git a/providers/google/create.go b/providers/google/create.go index 962a9566..1e345cbb 100644 --- a/providers/google/create.go +++ b/providers/google/create.go @@ -208,13 +208,13 @@ func CreateGoogleCluster(definition *pkgtypes.ClusterDefinition) error { return err } - // Wait for console Deployment Pods to transition to Running - log.Info("deploying kubefirst console and verifying cluster installation is complete") - consoleDeployment, err := k8s.ReturnDeploymentObject( + // Wait for last sync wave app transition to Running + log.Info("waiting for final sync wave Deployment to transition to Running") + crossplaneDeployment, err := k8s.ReturnDeploymentObject( kcfg.Clientset, - "app.kubernetes.io/name", - "console", - "kubefirst", + "app.kubernetes.io/instance", + "crossplane", + "crossplane-system", 1200, ) if err != nil { @@ -222,14 +222,16 @@ func CreateGoogleCluster(definition *pkgtypes.ClusterDefinition) error { ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, consoleDeployment, 120) + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) if err != nil { - log.Errorf("Error waiting for kubefirst api Deployment ready state: %s", err) + log.Errorf("Error waiting for all Apps to sync ready state: %s", err) ctrl.HandleError(err.Error()) return err } + log.Info("cluster creation complete") + cluster1KubefirstApiStopChannel := make(chan struct{}, 1) defer func() { close(cluster1KubefirstApiStopChannel) @@ -262,6 +264,29 @@ func CreateGoogleCluster(definition *pkgtypes.ClusterDefinition) error { log.Errorf("error adding default service entries for cluster %s: %s", cl.ClusterName, err) } } + + log.Info("waiting for kubefirst-api Deployment to transition to Running") + kubefirstAPI, err := k8s.ReturnDeploymentObject( + kcfg.Clientset, + "app.kubernetes.io/name", + "kubefirst-api", + "kubefirst", + 1200, + ) + if err != nil { + log.Errorf("Error finding kubefirst api Deployment: %s", err) + ctrl.HandleError(err.Error()) + return err + } + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300) + if err != nil { + log.Errorf("Error waiting for kubefirst-api to transition to Running: %s", err) + + ctrl.HandleError(err.Error()) + return err + } + + log.Info("cluster creation complete") return nil } diff --git a/providers/vultr/create.go b/providers/vultr/create.go index 347d1e67..8d34c7a8 100644 --- a/providers/vultr/create.go +++ b/providers/vultr/create.go @@ -185,13 +185,13 @@ func CreateVultrCluster(definition *pkgtypes.ClusterDefinition) error { return err } - // Wait for console Deployment Pods to transition to Running - log.Info("deploying kubefirst console and verifying cluster installation is complete") - consoleDeployment, err := k8s.ReturnDeploymentObject( + // Wait for last sync wave app transition to Running + log.Info("waiting for final sync wave Deployment to transition to Running") + crossplaneDeployment, err := k8s.ReturnDeploymentObject( kcfg.Clientset, - "app.kubernetes.io/name", - "console", - "kubefirst", + "app.kubernetes.io/instance", + "crossplane", + "crossplane-system", 1200, ) if err != nil { @@ -199,15 +199,14 @@ func CreateVultrCluster(definition *pkgtypes.ClusterDefinition) error { ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, consoleDeployment, 120) + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) if err != nil { - log.Errorf("Error waiting for kubefirst api Deployment ready state: %s", err) + log.Errorf("Error waiting for all Apps to sync ready state: %s", err) ctrl.HandleError(err.Error()) return err } - log.Info("cluster creation complete") //* export and import cluster err = ctrl.ExportClusterRecord() @@ -237,5 +236,28 @@ func CreateVultrCluster(definition *pkgtypes.ClusterDefinition) error { } } + log.Info("waiting for kubefirst-api Deployment to transition to Running") + kubefirstAPI, err := k8s.ReturnDeploymentObject( + kcfg.Clientset, + "app.kubernetes.io/name", + "kubefirst-api", + "kubefirst", + 1200, + ) + if err != nil { + log.Errorf("Error finding kubefirst api Deployment: %s", err) + ctrl.HandleError(err.Error()) + return err + } + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300) + if err != nil { + log.Errorf("Error waiting for kubefirst-api to transition to Running: %s", err) + + ctrl.HandleError(err.Error()) + return err + } + + log.Info("cluster creation complete") + return nil }