You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/bin/bash
# Check for necessary arguments
if [ "$#" -lt 2 ]; then
echo "Usage: $0 <yaml-file> <namespace> <iterations>"
exit 1
fi
YAML_FILE="$1"
NAMESPACE="$2"
ITERATIONS="${3:-1}" # Default to 1 iteration if not provided
# Function to check if all deployments are ready
wait_for_deployments() {
echo "Waiting for all deployments in namespace '$NAMESPACE' to be ready..."
# Get list of deployments in the namespace
deployments=$(kubectl get deployments -n "$NAMESPACE" -o jsonpath='{.items[*].metadata.name}')
for deployment in $deployments; do
echo "Waiting for deployment '$deployment' to be ready..."
kubectl rollout status deployment "$deployment" -n "$NAMESPACE"
if [ $? -ne 0 ]; then
echo "Deployment '$deployment' failed to become ready!"
exit 1
fi
done
echo "All deployments are ready!"
}
# Run the operation 'times' number of times
for ((i=1; i<=ITERATIONS; i++)); do
echo "Iteration $i / $ITERATIONS"
# Apply the YAML to the cluster
echo "Applying resources from $YAML_FILE..."
kubectl apply -f "$YAML_FILE" -n "$NAMESPACE"
if [ $? -ne 0 ]; then
echo "Failed to apply YAML to the cluster. Exiting..."
exit 1
fi
# Wait for all deployments in the namespace to be ready
wait_for_deployments
# Delete resources defined in the YAML file
echo "Deleting resources defined in $YAML_FILE..."
kubectl delete -f "$YAML_FILE" -n "$NAMESPACE" --timeout 2m
if [ $? -ne 0 ]; then
echo "Failed to delete resources from the cluster. Exiting..."
exit 1
fi
echo "Iteration $i completed!"
done
echo "All iterations completed successfully."
Anything else we need to know (please consider providing level 4 or above logs of CPI)?
E0215 09:59:22.978484 1 controller.go:301] "Unhandled Error" err="error processing service default/win-webserver (retrying with exponential backoff): failed to check if load balancer exists before cleanup: VirtualMachineService not found"
I0215 09:59:22.979002 1 event.go:389] "Event occurred" object="default/win-webserver" fieldPath="" kind="Service" apiVersion="v1" type="Warning" reason="SyncLoadBalancerFailed" message="Error syncing load balancer: failed to check if load balancer exists before cleanup: VirtualMachineService not found"
E0215 09:59:54.481770 1 loadbalancer.go:72] failed to get load balancer for default/win-webserver: VirtualMachineService not found
E0215 09:59:54.486790 1 controller.go:301] "Unhandled Error" err="error processing service default/win-webserver (retrying with exponential backoff): failed to check if load balancer exists before cleanup: VirtualMachineService not found"
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
Kernel (e.g. uname -a)
Install tools
Container runtime (CRI) and and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
Others
I believe the issue was contributed by the logic here
What happened?
When apply/delete the workload repeatedly, there is a chance that the service is not deleted.
What did you expect to happen?
CPI should be better handle the case.
How can we reproduce it (as minimally and precisely as possible)?
Workload yaml windows-workload-svc.yaml
Test script
./attach-test.sh ./windows-workload-svc.yaml default 10
Anything else we need to know (please consider providing level 4 or above logs of CPI)?
Kubernetes version
Cloud provider or hardware configuration
OS version
Kernel (e.g.
uname -a
)Install tools
Container runtime (CRI) and and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
Others
I believe the issue was contributed by the logic here
cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/loadbalancer.go
Lines 71 to 74 in ed2b673
The text was updated successfully, but these errors were encountered: