@@ -47,10 +47,9 @@ presubmits:
47
47
GINKGO_E2E_PID=
48
48
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -TERM "${GINKGO_E2E_PID}"; fi' TERM
49
49
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -INT "${GINKGO_E2E_PID}"; fi' INT
50
- # The final config gets dumped to stderr of the job.
51
- # It's the result of getting the original kind.yaml, manipulating it with sed,
50
+ # The final kind.yaml the result of getting the original kind.yaml, manipulating it with sed,
52
51
# and adding something at the end.
53
- kind create cluster --retain --config <( (
52
+ (
54
53
${kind_yaml_cmd[@]} |
55
54
# Configure potentially different images for control plane and workers.
56
55
sed -e "/^- role: control-plane/ a \ image: $control_plane_image" -e "/^- role: worker/ a \ image: $worker_image"
@@ -69,7 +68,9 @@ presubmits:
69
68
local:
70
69
dataDir: /tmp/etcd
71
70
EOF
72
- ) | tee /dev/stderr )
71
+ ) >/tmp/kind.yaml
72
+ cat /tmp/kind.yaml
73
+ kind create cluster --retain --config /tmp/kind.yaml
73
74
atexit () {
74
75
kind export logs "${ARTIFACTS}/kind"
75
76
kind delete cluster
@@ -135,10 +136,9 @@ presubmits:
135
136
GINKGO_E2E_PID=
136
137
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -TERM "${GINKGO_E2E_PID}"; fi' TERM
137
138
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -INT "${GINKGO_E2E_PID}"; fi' INT
138
- # The final config gets dumped to stderr of the job.
139
- # It's the result of getting the original kind.yaml, manipulating it with sed,
139
+ # The final kind.yaml the result of getting the original kind.yaml, manipulating it with sed,
140
140
# and adding something at the end.
141
- kind create cluster --retain --config <( (
141
+ (
142
142
${kind_yaml_cmd[@]} |
143
143
# Configure potentially different images for control plane and workers.
144
144
sed -e "/^- role: control-plane/ a \ image: $control_plane_image" -e "/^- role: worker/ a \ image: $worker_image"
@@ -157,7 +157,9 @@ presubmits:
157
157
local:
158
158
dataDir: /tmp/etcd
159
159
EOF
160
- ) | tee /dev/stderr )
160
+ ) >/tmp/kind.yaml
161
+ cat /tmp/kind.yaml
162
+ kind create cluster --retain --config /tmp/kind.yaml
161
163
atexit () {
162
164
kind export logs "${ARTIFACTS}/kind"
163
165
kind delete cluster
@@ -189,7 +191,7 @@ presubmits:
189
191
preset-kind-volume-mounts : " true"
190
192
annotations :
191
193
testgrid-dashboards : sig-node-dynamic-resource-allocation, sig-node-presubmits
192
- description : Runs E2E tests for Dynamic Resource Allocation beta features against a Kubernetes master cluster created with sigs.k8s.io/kind with kubelet from the previous release.
194
+ description : Runs E2E tests for Dynamic Resource Allocation beta features against a Kubernetes master cluster created with sigs.k8s.io/kind with kubelet from the "current - 1" release.
193
195
194
196
decorate : true
195
197
decoration_config :
@@ -219,17 +221,20 @@ presubmits:
219
221
kind build node-image --image="$control_plane_image" "${kind_node_source}"
220
222
major=$(echo "$revision" | sed -e 's/^v\([0-9]*\).*/\1/')
221
223
minor=$(echo "$revision" | sed -e 's/^v[0-9]*\([0-9]*\).*/\1/')
222
- # TODO: find latest patch release
224
+ previous_minor=$((minor - 1))
225
+ # latest-*.txt is only the latest release candidate and can be lower than stable-*.txt.
226
+ # Pick whatever is more recent to ensure that we cover release candidates for older patch releases.
227
+ $ TODO: only in the periodic job. In the presubmit, test against a known-good previous release.
228
+ previous=$((curl --silent -L https://dl.k8s.io/release/latest-$major.$previous_minor.txt && echo && curl --silent -L https://dl.k8s.io/release/stable-$major.$previous_minor.txt && echo) | sort -n | tail -1)
223
229
worker_image=dra/node:skewed1
224
- kind build node-image --image="$worker_image" "https://dl.k8s.io/v$major.$((minor - 1)).0 /kubernetes-server-linux-amd64.tar.gz"
230
+ kind build node-image --image="$worker_image" "https://dl.k8s.io/$previous /kubernetes-server-linux-amd64.tar.gz"
225
231
# We might need support for disabling tests which need a recent kubelet. We'll see...
226
232
GINKGO_E2E_PID=
227
233
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -TERM "${GINKGO_E2E_PID}"; fi' TERM
228
234
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -INT "${GINKGO_E2E_PID}"; fi' INT
229
- # The final config gets dumped to stderr of the job.
230
- # It's the result of getting the original kind.yaml, manipulating it with sed,
235
+ # The final kind.yaml the result of getting the original kind.yaml, manipulating it with sed,
231
236
# and adding something at the end.
232
- kind create cluster --retain --config <( (
237
+ (
233
238
${kind_yaml_cmd[@]} |
234
239
# Configure potentially different images for control plane and workers.
235
240
sed -e "/^- role: control-plane/ a \ image: $control_plane_image" -e "/^- role: worker/ a \ image: $worker_image"
@@ -248,7 +253,105 @@ presubmits:
248
253
local:
249
254
dataDir: /tmp/etcd
250
255
EOF
251
- ) | tee /dev/stderr )
256
+ ) >/tmp/kind.yaml
257
+ cat /tmp/kind.yaml
258
+ kind create cluster --retain --config /tmp/kind.yaml
259
+ atexit () {
260
+ kind export logs "${ARTIFACTS}/kind"
261
+ kind delete cluster
262
+ }
263
+ trap atexit EXIT
264
+ KUBECONFIG=${HOME}/.kube/config ${ginkgo} run --nodes=8 --timeout=24h --silence-skips --force-newlines --no-color --label-filter="DRA && Feature: isSubsetOf { OffByDefault, DynamicResourceAllocation } && !Alpha && !Flaky && !Slow" ${e2e_test} -- -provider=local -report-dir="${ARTIFACTS}" -report-complete-ginkgo -report-complete-junit &
265
+ GINKGO_E2E_PID=$!
266
+ wait "${GINKGO_E2E_PID}"
267
+ # docker-in-docker needs privileged mode
268
+ securityContext :
269
+ privileged : true
270
+ resources :
271
+ limits :
272
+ cpu : 2
273
+ memory : 6Gi
274
+ requests :
275
+ cpu : 2
276
+ memory : 6Gi
277
+
278
+ - name : pull-kubernetes-kind-dra-n-2-canary
279
+ cluster : eks-prow-build-cluster
280
+ skip_branches :
281
+ - release-\d+\.\d+ # per-release image
282
+ always_run : false
283
+ optional : true
284
+ labels :
285
+ preset-service-account : " true"
286
+ preset-dind-enabled : " true"
287
+ preset-kind-volume-mounts : " true"
288
+ annotations :
289
+ testgrid-dashboards : sig-node-dynamic-resource-allocation, sig-node-presubmits
290
+ description : Runs E2E tests for Dynamic Resource Allocation beta features against a Kubernetes master cluster created with sigs.k8s.io/kind with kubelet from the "current - 2" release.
291
+
292
+ decorate : true
293
+ decoration_config :
294
+ timeout : 90m
295
+ path_alias : k8s.io/kubernetes
296
+ spec :
297
+ containers :
298
+ - image : gcr.io/k8s-staging-test-infra/kubekins-e2e:v20250527-1b2b10e804-master
299
+ command :
300
+ - runner.sh
301
+ args :
302
+ - /bin/bash
303
+ - -xce
304
+ - |
305
+ set -o pipefail
306
+ # A presubmit job uses the checked out and merged source code.
307
+ revision=$(git describe --tags)
308
+ kind_yaml_cmd=(cat test/e2e/dra/kind.yaml)
309
+ kind_node_source=.
310
+ features=( )
311
+ make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test"
312
+ ginkgo=_output/bin/ginkgo
313
+ e2e_test=_output/bin/e2e.test
314
+ # The latest kind is assumed to work also for older release branches, should this job get forked.
315
+ curl --fail --silent --show-error --location https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind
316
+ control_plane_image=dra/node:latest
317
+ kind build node-image --image="$control_plane_image" "${kind_node_source}"
318
+ major=$(echo "$revision" | sed -e 's/^v\([0-9]*\).*/\1/')
319
+ minor=$(echo "$revision" | sed -e 's/^v[0-9]*\([0-9]*\).*/\1/')
320
+ previous_minor=$((minor - 2))
321
+ # latest-*.txt is only the latest release candidate and can be lower than stable-*.txt.
322
+ # Pick whatever is more recent to ensure that we cover release candidates for older patch releases.
323
+ $ TODO: only in the periodic job. In the presubmit, test against a known-good previous release.
324
+ previous=$((curl --silent -L https://dl.k8s.io/release/latest-$major.$previous_minor.txt && echo && curl --silent -L https://dl.k8s.io/release/stable-$major.$previous_minor.txt && echo) | sort -n | tail -1)
325
+ worker_image=dra/node:skewed2
326
+ kind build node-image --image="$worker_image" "https://dl.k8s.io/$previous/kubernetes-server-linux-amd64.tar.gz"
327
+ # We might need support for disabling tests which need a recent kubelet. We'll see...
328
+ GINKGO_E2E_PID=
329
+ trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -TERM "${GINKGO_E2E_PID}"; fi' TERM
330
+ trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -INT "${GINKGO_E2E_PID}"; fi' INT
331
+ # The final kind.yaml the result of getting the original kind.yaml, manipulating it with sed,
332
+ # and adding something at the end.
333
+ (
334
+ ${kind_yaml_cmd[@]} |
335
+ # Configure potentially different images for control plane and workers.
336
+ sed -e "/^- role: control-plane/ a \ image: $control_plane_image" -e "/^- role: worker/ a \ image: $worker_image"
337
+
338
+ # Additional features are not in kind.yaml, but they can be added at the end.
339
+ for feature in ${features[@]}; do echo " ${feature}: true"; done
340
+
341
+ # Append ClusterConfiguration which causes etcd to use /tmp
342
+ # (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
343
+ # There's no kubeadmConfigPatches in any kind.yaml, so we can append at the end.
344
+ cat <<EOF
345
+ kubeadmConfigPatches:
346
+ - |
347
+ kind: ClusterConfiguration
348
+ etcd:
349
+ local:
350
+ dataDir: /tmp/etcd
351
+ EOF
352
+ ) >/tmp/kind.yaml
353
+ cat /tmp/kind.yaml
354
+ kind create cluster --retain --config /tmp/kind.yaml
252
355
atexit () {
253
356
kind export logs "${ARTIFACTS}/kind"
254
357
kind delete cluster
0 commit comments