Skip to content

Commit

Permalink
increase timeouts due to letsencrypt certs (#254)
Browse files Browse the repository at this point in the history
* fix terraform workspace remote url path with repo .git

* increase timeout waiting for letsencrypt certificates

* increase wait for getting the k8s object
  • Loading branch information
jarededwards authored Dec 4, 2023
1 parent f76975b commit 11f902a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 36 deletions.
12 changes: 5 additions & 7 deletions providers/aws/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,23 +220,23 @@ 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)

ctrl.HandleError(err.Error())
return err
}

log.Info("cluster creation complete")

//* export and import cluster
err = ctrl.ExportClusterRecord()
if err != nil {
Expand All @@ -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
Expand Down
11 changes: 4 additions & 7 deletions providers/civo/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand Down
12 changes: 4 additions & 8 deletions providers/digitalocean/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,23 +193,22 @@ 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)

ctrl.HandleError(err.Error())
return err
}

log.Info("cluster creation complete")

//* export and import cluster
err = ctrl.ExportClusterRecord()
if err != nil {
Expand All @@ -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
Expand Down
13 changes: 5 additions & 8 deletions providers/google/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,23 +215,22 @@ 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)

ctrl.HandleError(err.Error())
return err
}

log.Info("cluster creation complete")

cluster1KubefirstApiStopChannel := make(chan struct{}, 1)
defer func() {
close(cluster1KubefirstApiStopChannel)
Expand All @@ -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
Expand All @@ -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,
Expand Down
10 changes: 4 additions & 6 deletions providers/vultr/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,22 @@ 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)

ctrl.HandleError(err.Error())
return err
}


//* export and import cluster
err = ctrl.ExportClusterRecord()
if err != nil {
Expand All @@ -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
Expand Down

0 comments on commit 11f902a

Please sign in to comment.