From 11f902a328aa664e5915b5702336886ead4fa0c6 Mon Sep 17 00:00:00 2001 From: Jared Edwards Date: Mon, 4 Dec 2023 10:33:43 -0700 Subject: [PATCH] increase timeouts due to letsencrypt certs (#254) * fix terraform workspace remote url path with repo .git * increase timeout waiting for letsencrypt certificates * increase wait for getting the k8s object --- providers/aws/create.go | 12 +++++------- providers/civo/create.go | 11 ++++------- providers/digitalocean/create.go | 12 ++++-------- providers/google/create.go | 13 +++++-------- providers/vultr/create.go | 10 ++++------ 5 files changed, 22 insertions(+), 36 deletions(-) diff --git a/providers/aws/create.go b/providers/aws/create.go index d1e25a25..de636e68 100644 --- a/providers/aws/create.go +++ b/providers/aws/create.go @@ -220,14 +220,16 @@ func CreateAWSCluster(definition *pkgtypes.ClusterDefinition) error { "app.kubernetes.io/instance", "crossplane", "crossplane-system", - 1200, + 3600, ) if err != nil { - log.Errorf("Error finding kubefirst api Deployment: %s", err) + log.Errorf("Error finding crossplane Deployment: %s", err) ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) + + log.Infof("waiting on dns, tls certificates from letsencrypt and remaining sync waves.\n this may take up to 60 minutes but regularly completes in under 20 minutes") + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 3600) if err != nil { log.Errorf("Error waiting for all Apps to sync ready state: %s", err) @@ -235,8 +237,6 @@ func CreateAWSCluster(definition *pkgtypes.ClusterDefinition) error { return err } - log.Info("cluster creation complete") - //* export and import cluster err = ctrl.ExportClusterRecord() if err != nil { @@ -253,8 +253,6 @@ func CreateAWSCluster(definition *pkgtypes.ClusterDefinition) error { return err } - log.Info("cluster creation complete") - telemetry.SendEvent(ctrl.TelemetryEvent, telemetry.ClusterInstallCompleted, "") // Create default service entries diff --git a/providers/civo/create.go b/providers/civo/create.go index c65d7804..3ebf6da5 100644 --- a/providers/civo/create.go +++ b/providers/civo/create.go @@ -199,19 +199,18 @@ func CreateCivoCluster(definition *pkgtypes.ClusterDefinition) error { 1200, ) if err != nil { - log.Errorf("Error finding kubefirst api Deployment: %s", err) + log.Errorf("Error finding crossplane Deployment: %s", err) ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) + log.Infof("waiting on dns, tls certificates from letsencrypt and remaining sync waves.\n this may take up to 60 minutes but regularly completes in under 20 minutes") + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 3600) if err != nil { 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) @@ -234,8 +233,6 @@ func CreateCivoCluster(definition *pkgtypes.ClusterDefinition) error { return err } - log.Info("cluster creation complete") - telemetry.SendEvent(ctrl.TelemetryEvent, telemetry.ClusterInstallCompleted, "") // Create default service entries @@ -252,7 +249,7 @@ func CreateCivoCluster(definition *pkgtypes.ClusterDefinition) error { "app.kubernetes.io/name", "kubefirst-api", "kubefirst", - 1200, + 3600, ) if err != nil { log.Errorf("Error finding kubefirst api Deployment: %s", err) diff --git a/providers/digitalocean/create.go b/providers/digitalocean/create.go index 1864ec3e..d363a52c 100644 --- a/providers/digitalocean/create.go +++ b/providers/digitalocean/create.go @@ -193,14 +193,15 @@ func CreateDigitaloceanCluster(definition *pkgtypes.ClusterDefinition) error { "app.kubernetes.io/instance", "crossplane", "crossplane-system", - 1200, + 3600, ) if err != nil { - log.Errorf("Error finding kubefirst api Deployment: %s", err) + log.Errorf("Error finding crossplane Deployment: %s", err) ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) + log.Infof("waiting on dns, tls certificates from letsencrypt and remaining sync waves.\n this may take up to 60 minutes but regularly completes in under 20 minutes") + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 3600) if err != nil { log.Errorf("Error waiting for all Apps to sync ready state: %s", err) @@ -208,8 +209,6 @@ func CreateDigitaloceanCluster(definition *pkgtypes.ClusterDefinition) error { return err } - log.Info("cluster creation complete") - //* export and import cluster err = ctrl.ExportClusterRecord() if err != nil { @@ -226,10 +225,7 @@ func CreateDigitaloceanCluster(definition *pkgtypes.ClusterDefinition) error { return err } - log.Info("cluster creation complete") - // Telemetry handler - telemetry.SendEvent(ctrl.TelemetryEvent, telemetry.ClusterInstallCompleted, "") // Create default service entries diff --git a/providers/google/create.go b/providers/google/create.go index 1e345cbb..f28749da 100644 --- a/providers/google/create.go +++ b/providers/google/create.go @@ -215,14 +215,15 @@ func CreateGoogleCluster(definition *pkgtypes.ClusterDefinition) error { "app.kubernetes.io/instance", "crossplane", "crossplane-system", - 1200, + 3600, ) if err != nil { - log.Errorf("Error finding kubefirst api Deployment: %s", err) + log.Errorf("Error finding crossplane Deployment: %s", err) ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) + log.Infof("waiting on dns, tls certificates from letsencrypt and remaining sync waves.\n this may take up to 60 minutes but regularly completes in under 20 minutes") + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 3600) if err != nil { log.Errorf("Error waiting for all Apps to sync ready state: %s", err) @@ -230,8 +231,6 @@ func CreateGoogleCluster(definition *pkgtypes.ClusterDefinition) error { return err } - log.Info("cluster creation complete") - cluster1KubefirstApiStopChannel := make(chan struct{}, 1) defer func() { close(cluster1KubefirstApiStopChannel) @@ -253,8 +252,6 @@ func CreateGoogleCluster(definition *pkgtypes.ClusterDefinition) error { return err } - log.Info("cluster creation complete") - telemetry.SendEvent(ctrl.TelemetryEvent, telemetry.ClusterInstallCompleted, "") // Create default service entries @@ -264,7 +261,7 @@ 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, diff --git a/providers/vultr/create.go b/providers/vultr/create.go index 8d34c7a8..041c09f7 100644 --- a/providers/vultr/create.go +++ b/providers/vultr/create.go @@ -192,14 +192,15 @@ func CreateVultrCluster(definition *pkgtypes.ClusterDefinition) error { "app.kubernetes.io/instance", "crossplane", "crossplane-system", - 1200, + 3600, ) if err != nil { - log.Errorf("Error finding kubefirst api Deployment: %s", err) + log.Errorf("Error finding crossplane Deployment: %s", err) ctrl.HandleError(err.Error()) return err } - _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 300) + log.Infof("waiting on dns, tls certificates from letsencrypt and remaining sync waves.\n this may take up to 60 minutes but regularly completes in under 20 minutes") + _, err = k8s.WaitForDeploymentReady(kcfg.Clientset, crossplaneDeployment, 3600) if err != nil { log.Errorf("Error waiting for all Apps to sync ready state: %s", err) @@ -207,7 +208,6 @@ func CreateVultrCluster(definition *pkgtypes.ClusterDefinition) error { return err } - //* export and import cluster err = ctrl.ExportClusterRecord() if err != nil { @@ -224,8 +224,6 @@ func CreateVultrCluster(definition *pkgtypes.ClusterDefinition) error { return err } - log.Info("cluster creation complete") - telemetry.SendEvent(ctrl.TelemetryEvent, telemetry.ClusterInstallCompleted, "") // Create default service entries