@@ -98,17 +98,34 @@ resource "kubernetes_manifest" "workload_ingress" {
98
98
}
99
99
}
100
100
wait {
101
- # Wait until the ingress controller is fully available
102
- # This requires a TLS secret to be created
103
- # and will give time for the ALB to finish provisioning (private IPs are available)
101
+ # Wait until the load balancer is provisioned
102
+ # The subsequent wait will give time for the ALB to finish provisioning (private IPs are available)
103
+ # The ingress controller will become fully available when the TLS secret is created, but that may take much longer
104
104
condition {
105
- type = " Available "
105
+ type = " LoadBalancerReady "
106
106
status = " True"
107
107
}
108
108
}
109
+ timeouts {
110
+ create = " 20m"
111
+ update = " 20m"
112
+ delete = " 20m"
113
+ }
114
+ }
115
+
116
+ # Give some more time for ALB private IPs to become available in case only the ingress is being re-created
117
+ resource "time_sleep" "wait_for_ingress_provisioning" {
118
+ depends_on = [restapi_object . workload_nlb_dns , kubernetes_manifest . workload_ingress ]
119
+
120
+ destroy_duration = " 5s"
121
+ create_duration = " 7m"
122
+ triggers = {
123
+ ingress_uid = kubernetes_manifest.workload_ingress.object .metadata.uid
124
+ }
109
125
}
110
126
111
127
data "kubernetes_service" "ingress_router_service" {
128
+ depends_on = [time_sleep . wait_for_ingress_provisioning ]
112
129
metadata {
113
130
name = " router-${ kubernetes_manifest . workload_ingress . object . metadata . name } "
114
131
namespace = " openshift-ingress"
@@ -169,7 +186,7 @@ resource "restapi_object" "workload_nlb_dns_cleanup" {
169
186
# Need to get private IPs (private_ips) of the ALB to include in ACL
170
187
data "ibm_is_lb" "ingress_vpc_alb" {
171
188
name = " kube-${ local . cluster_id } -${ replace (data. kubernetes_service . ingress_router_service . metadata [0 ]. uid , " -" , " " )} "
172
- depends_on = [time_sleep . wait_for_alb_provisioning ]
189
+ depends_on = [time_sleep . wait_for_alb_provisioning , time_sleep . wait_for_ingress_provisioning ]
173
190
}
174
191
175
192
# Assuming all SLZ zones for the ALB subnet will have the same ACL
0 commit comments