cloud-bulldozer / k8s-netperf

Running Networking Performance Tests against K8s
Apache License 2.0
28 stars 17 forks source link

Wait for namespace deletion #142

Closed rsevilla87 closed 3 months ago

rsevilla87 commented 4 months ago

Type of change

Description

It's easier and faster to wait for the namespace deletion rather than resource by resource.

It also fixes a race condition that happens when you execute k8s-netperf twice without waiting for some time between executions, the netperf namespace is still in Deleting status and k8s-netperf crashes. e.g:

$ ./bin/amd64/k8s-netperf --config examples/netperf-full.yml  --debug --all                                                                                                                      
INFO[2024-04-30 11:19:37] Starting k8s-netperf (141@b939249af9389f95d195eedcb47dce131a209342)                                                                                                                                                 
INFO[2024-04-30 11:19:37] 📒 Reading examples/netperf-full.yml file.                                                                                                                                                                          
INFO[2024-04-30 11:19:37] 📒 Reading examples/netperf-full.yml file - using ConfigV2 Method.                                                                                                                                                  
INFO[2024-04-30 11:19:37] Cleaning resources created by k8s-netperf                                                                                                                                                                           
INFO[2024-04-30 11:19:40] ⏰ Waiting for client-across Deployment to deleted...                                                                                                                                                               
INFO[2024-04-30 11:19:42] ⏰ Waiting for client-host Deployment to deleted...                                          
INFO[2024-04-30 11:19:44] ⏰ Waiting for server Deployment to deleted...                                                                                                                                                                      
INFO[2024-04-30 11:19:46] ⏰ Waiting for server-host Deployment to deleted...                                                                                                                                                                 
INFO[2024-04-30 11:19:49] 🔬 prometheus discovered at openshift-monitoring                                                                                                                                                                    
INFO[2024-04-30 11:19:51] ♻️  Namespace already exists, reusing it                                                                                                                                                                             
INFO[2024-04-30 11:19:51] ♻️  Service account already exists, reusing it                                                                                                                                                                      
INFO[2024-04-30 11:19:51] ♻️  Role binding already exists, reusing it                                                                                                                                                                          
WARN[2024-04-30 11:19:52] ⚠️   Single node per zone and/or no zone labels                                                                                                                                                                     
DEBU[2024-04-30 11:19:52] Number of nodes with role worker: 3                                                                                                                                                                                 
DEBU[2024-04-30 11:19:52] Looking for service iperf-service in namespace netperf                                                                                                                                                              
INFO[2024-04-30 11:19:52] 🚀 Creating service for iperf-service in namespace netperf                                                                                                                                                          
FATA[2024-04-30 11:19:52] 😥 Unable to create iperf service: services "iperf-service" is forbidden: unable to create new content in namespace netperf because it is being terminated

Related Tickets & Documents

Checklist before requesting a review

Testing