From 246f93a9e34cd5e662c9c3d10a2aee3b7f57b7dc Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Mon, 19 Jun 2023 18:55:57 +0300 Subject: [PATCH] Wait until the ingress has an ip address 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 --- test/addons/demo/start | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/addons/demo/start b/test/addons/demo/start index 21ae90c9f..79c98162c 100755 --- a/test/addons/demo/start +++ b/test/addons/demo/start @@ -7,6 +7,7 @@ import os import sys import time +import drenv from drenv import commands from drenv import kubectl @@ -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, +)