Skip to content

Commit 91b3f00

Browse files
committed
add kernel limit job
1 parent 4c11c56 commit 91b3f00

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

hack/ci/kernel.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: kernel-limits
5+
namespace: default
6+
spec:
7+
template:
8+
metadata:
9+
labels:
10+
autoscaling.cast.ai/removal-disabled: "true"
11+
spec:
12+
containers:
13+
- name: init
14+
image: alpine:3.14
15+
command:
16+
- /bin/sh
17+
- -xc
18+
- |
19+
sysctl fs.inotify.max_user_watches=1048576
20+
sysctl fs.inotify.max_user_instances=1024
21+
securityContext:
22+
privileged: true
23+
restartPolicy: Never
24+
backoffLimit: 1

hack/ci/run-e2e-tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ echo "Creating kind cluster $KIND_CLUSTER_NAME…"
6363
kind create cluster --name "$KIND_CLUSTER_NAME"
6464
chmod 600 "$KUBECONFIG"
6565

66+
# apply kernel limits job first and wait for completion
67+
echo "Applying kernel limits job…"
68+
kubectl apply --filename hack/ci/kernel.yaml
69+
kubectl wait --for=condition=Complete job/kernel-limits --timeout=300s
70+
echo "Kernel limits job completed."
71+
6672
# store logs as artifacts
6773
make protokol
6874
_tools/protokol --output "$ARTIFACTS/logs" --namespace 'kcp-*' --namespace 'e2e-*' >/dev/null 2>&1 &
@@ -109,6 +115,9 @@ WHAT="${WHAT:-./test/e2e/...}"
109115
TEST_ARGS="${TEST_ARGS:--timeout 2h -v}"
110116
E2E_PARALLELISM=${E2E_PARALLELISM:-2}
111117

118+
# Increase file descriptor limit for CI environments
119+
ulimit -n 65536
120+
112121
(set -x; go test -tags e2e -parallel $E2E_PARALLELISM $TEST_ARGS "$WHAT")
113122

114123
echo "Done. :-)"

hack/run-e2e-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ fi
5858

5959
echo "Kubeconfig is in $KUBECONFIG."
6060

61+
# apply kernel limits job first and wait for completion
62+
echo "Applying kernel limits job…"
63+
kubectl apply --filename hack/ci/kernel.yaml
64+
kubectl wait --for=condition=Complete job/kernel-limits --timeout=300s
65+
echo "Kernel limits job completed."
66+
6167
# deploying operator CRDs
6268
echo "Deploying operator CRDs…"
6369
kubectl apply --kustomize config/crd

0 commit comments

Comments
 (0)