Skip to content

Commit 9153567

Browse files
p3rf Teamcopybara-github
authored andcommitted
Wait for service to be assigned an IP addr.
It's insufficient to simply wait for the deployment to be available - we also need to wait for the service *and* to wait for the service to be assigned an external IP address. PiperOrigin-RevId: 721482040
1 parent 0708892 commit 9153567

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

perfkitbenchmarker/container_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,11 +946,12 @@ def WaitForResource(
946946
namespace: str | None = None,
947947
timeout: int = vm_util.DEFAULT_TIMEOUT,
948948
wait_for_all: bool = False,
949+
condition_type='condition=',
949950
):
950951
"""Waits for a condition on a Kubernetes resource (eg: deployment, pod)."""
951952
run_cmd = [
952953
'wait',
953-
f'--for=condition={condition_name}',
954+
f'--for={condition_type}{condition_name}',
954955
f'--timeout={timeout}s',
955956
resource_name,
956957
]

perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ def _PrepareCluster(benchmark_spec: bm_spec.BenchmarkSpec):
9595
)
9696

9797
cluster.WaitForResource('deploy/fib', 'available', namespace='fib')
98+
cluster.WaitForResource(
99+
'service/fib',
100+
'{.status.loadBalancer.ingress[0].ip}',
101+
namespace='fib',
102+
condition_type='jsonpath=',
103+
)
98104

99105

100106
def _PrepareLocust(benchmark_spec: bm_spec.BenchmarkSpec):

0 commit comments

Comments
 (0)