@@ -57,13 +57,32 @@ jobs:
5757 - name : Create k3s cluster (k3d)
5858 if : ${{ matrix.provider == 'k8s' }}
5959 run : |
60- k3d cluster create unity-builder --agents 1 --wait
60+ # Create cluster with relaxed eviction thresholds to prevent premature evictions
61+ k3d cluster create unity-builder \
62+ --agents 1 \
63+ --k3s-arg '--kubelet-arg=eviction-hard=memory.available<50Mi@agent:0' \
64+ --k3s-arg '--kubelet-arg=eviction-soft=memory.available<100Mi@agent:0' \
65+ --wait
6166 kubectl config current-context | cat
6267 - name : Verify cluster readiness
6368 if : ${{ matrix.provider == 'k8s' }}
6469 run : |
6570 for i in {1..60}; do kubectl get nodes && break || sleep 5; done
6671 kubectl get storageclass
72+ # Show node resources
73+ kubectl describe nodes | grep -A 5 "Allocated resources" || true
74+ - name : Clean up old K8s resources before tests
75+ if : ${{ matrix.provider == 'k8s' }}
76+ run : |
77+ # Clean up any leftover jobs, pods, and PVCs from previous test runs
78+ kubectl delete jobs --all --ignore-not-found=true || true
79+ kubectl delete pods --all --ignore-not-found=true || true
80+ kubectl delete pvc --all --ignore-not-found=true || true
81+ kubectl delete secrets --all --ignore-not-found=true || true
82+ # Wait a moment for cleanup to complete
83+ sleep 5
84+ # Show current resource usage
85+ kubectl top nodes 2>/dev/null || echo "Metrics server not available"
6786 - name : Start LocalStack (S3)
6887 uses :
localstack/[email protected] 6988 with :
98117 versioning : None
99118 KUBE_STORAGE_CLASS : ${{ matrix.provider == 'k8s' && 'local-path' || '' }}
100119 PROVIDER_STRATEGY : ${{ matrix.provider }}
120+ # Set lower resource requests for tests to prevent evictions in k3d
121+ containerCpu : ${{ matrix.provider == 'k8s' && '512' || '' }}
122+ containerMemory : ${{ matrix.provider == 'k8s' && '512' || '' }}
101123 AWS_ACCESS_KEY_ID : test
102124 AWS_SECRET_ACCESS_KEY : test
103125 AWS_S3_ENDPOINT : http://localhost:4566
0 commit comments