Skip to content

Commit

Permalink
Wait until the ingress has an ip address
Browse files Browse the repository at this point in the history
After deploying an ingress, it can take up to 40 seconds before it get
an ip address. In this stage, accessing the ingress URL will return 404
"Not Found" error.

Wait until the ingress reports an ip address before finishing the start
script.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Jun 22, 2023
1 parent d0e5077 commit 246f93a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/addons/demo/start
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import os
import sys
import time

import drenv
from drenv import commands
from drenv import kubectl

Expand Down Expand Up @@ -61,3 +62,12 @@ while True:
else:
print(f"Ingress configured in {time.monotonic() - start:.3f} seconds")
break

print("Waiting until ingress is ready")
# It can take 40 seconds until the ingress gets an ingress ip address.
drenv.wait_for(
"ingress/demo-ingress",
output="jsonpath={.status.loadBalancer.ingress}",
timeout=120,
profile=cluster,
)

0 comments on commit 246f93a

Please sign in to comment.