Ensure ELB is resolvable before marking as ready
@@ -18,6 +18,7 @@ package controllers
import (
"context"
+ "net"
"time"
"github.com/go-logr/logr"
@@ -166,6 +167,11 @@ func reconcileNormal(clusterScope *scope.ClusterScope) (reconcile.Result, error)
return reconcile.Result{RequeueAfter: 15 * time.Second}, nil
}
+ if _, err := net.LookupIP(awsCluster.Status.Network.APIServerELB.DNSName); err != nil {
+ clusterScope.Info("Waiting on API server ELB DNS name to resolve")
+ return reconcile.Result{RequeueAfter: 15 * time.Second}, nil
+ }
+
awsCluster.Spec.ControlPlaneEndpoint = clusterv1.APIEndpoint{
Host: awsCluster.Status.Network.APIServerELB.DNSName,
Port: clusterScope.APIServerPort(),
