@@ -32,27 +32,44 @@ presubmits:
32
32
- |
33
33
set -o pipefail
34
34
# A presubmit job uses the checked out and merged source code.
35
- kind_yaml=$(cat test/e2e/dra/kind.yaml)
35
+ revision=$(git describe --tags)
36
+ kind_yaml_cmd=(cat test/e2e/dra/kind.yaml)
36
37
kind_node_source=.
37
38
features=( )
38
39
make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test"
39
40
ginkgo=_output/bin/ginkgo
40
41
e2e_test=_output/bin/e2e.test
41
42
# The latest kind is assumed to work also for older release branches, should this job get forked.
42
43
curl --fail --silent --show-error --location https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind
43
- kind build node-image --image=dra/node:latest "${kind_node_source}"
44
+ control_plane_image=dra/node:latest
45
+ kind build node-image --image="$control_plane_image" "${kind_node_source}"
46
+ worker_image="$control_plane_image"
44
47
GINKGO_E2E_PID=
45
48
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -TERM "${GINKGO_E2E_PID}"; fi' TERM
46
49
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -INT "${GINKGO_E2E_PID}"; fi' INT
47
- # Inject ClusterConfiguration which causes etcd to use /tmp
48
- # (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
49
- if ! echo "$kind_yaml" | grep -q '^kubeadmConfigPatches:'; then
50
- # Add kubeadmConfigPatches list before node list, there is none at the moment.
51
- kind_yaml=$(echo "$kind_yaml" | sed -e '/nodes:/ i\kubeadmConfigPatches:')
52
- fi
53
- kind_yaml=$(echo "$kind_yaml" | sed -e '/^kubeadmConfigPatches:/ a\- |\n kind: ClusterConfiguration\n etcd:\n local:\n dataDir: /tmp/etcd')
54
- # Additional features are not in kind.yaml, but they can be added at the end.
55
- kind create cluster --retain --config <(echo "${kind_yaml}"; for feature in ${features[@]}; do echo " ${feature}: true"; done) --image dra/node:latest
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,
52
+ # and adding something at the end.
53
+ kind create cluster --retain --config <( (
54
+ ${kind_yaml_cmd[@]} |
55
+ # Configure potentially different images for control plane and workers.
56
+ sed -e "/^- role: control-plane/ a \ image: $control_plane_image" -e "/^- role: worker/ a \ image: $worker_image"
57
+
58
+ # Additional features are not in kind.yaml, but they can be added at the end.
59
+ for feature in ${features[@]}; do echo " ${feature}: true"; done
60
+
61
+ # Append ClusterConfiguration which causes etcd to use /tmp
62
+ # (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
63
+ # There's no kubeadmConfigPatches in any kind.yaml, so we can append at the end.
64
+ cat <<EOF
65
+ kubeadmConfigPatches:
66
+ - |
67
+ kind: ClusterConfiguration
68
+ etcd:
69
+ local:
70
+ dataDir: /tmp/etcd
71
+ EOF
72
+ ) | tee /dev/stderr )
56
73
atexit () {
57
74
kind export logs "${ARTIFACTS}/kind"
58
75
kind delete cluster
@@ -101,7 +118,8 @@ presubmits:
101
118
- |
102
119
set -o pipefail
103
120
# A presubmit job uses the checked out and merged source code.
104
- kind_yaml=$(cat test/e2e/dra/kind.yaml)
121
+ revision=$(git describe --tags)
122
+ kind_yaml_cmd=(cat test/e2e/dra/kind.yaml)
105
123
kind_node_source=.
106
124
# Which DRA features exist can change over time.
107
125
features=( $( grep '"DRA' pkg/features/kube_features.go | sed 's/.*"\(.*\)"/\1/' ) )
@@ -111,19 +129,35 @@ presubmits:
111
129
e2e_test=_output/bin/e2e.test
112
130
# The latest kind is assumed to work also for older release branches, should this job get forked.
113
131
curl --fail --silent --show-error --location https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind
114
- kind build node-image --image=dra/node:latest "${kind_node_source}"
132
+ control_plane_image=dra/node:latest
133
+ kind build node-image --image="$control_plane_image" "${kind_node_source}"
134
+ worker_image="$control_plane_image"
115
135
GINKGO_E2E_PID=
116
136
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -TERM "${GINKGO_E2E_PID}"; fi' TERM
117
137
trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -INT "${GINKGO_E2E_PID}"; fi' INT
118
- # Inject ClusterConfiguration which causes etcd to use /tmp
119
- # (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
120
- if ! echo "$kind_yaml" | grep -q '^kubeadmConfigPatches:'; then
121
- # Add kubeadmConfigPatches list before node list, there is none at the moment.
122
- kind_yaml=$(echo "$kind_yaml" | sed -e '/nodes:/ i\kubeadmConfigPatches:')
123
- fi
124
- kind_yaml=$(echo "$kind_yaml" | sed -e '/^kubeadmConfigPatches:/ a\- |\n kind: ClusterConfiguration\n etcd:\n local:\n dataDir: /tmp/etcd')
125
- # Additional features are not in kind.yaml, but they can be added at the end.
126
- kind create cluster --retain --config <(echo "${kind_yaml}"; for feature in ${features[@]}; do echo " ${feature}: true"; done) --image dra/node:latest
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,
140
+ # and adding something at the end.
141
+ kind create cluster --retain --config <( (
142
+ ${kind_yaml_cmd[@]} |
143
+ # Configure potentially different images for control plane and workers.
144
+ sed -e "/^- role: control-plane/ a \ image: $control_plane_image" -e "/^- role: worker/ a \ image: $worker_image"
145
+
146
+ # Additional features are not in kind.yaml, but they can be added at the end.
147
+ for feature in ${features[@]}; do echo " ${feature}: true"; done
148
+
149
+ # Append ClusterConfiguration which causes etcd to use /tmp
150
+ # (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
151
+ # There's no kubeadmConfigPatches in any kind.yaml, so we can append at the end.
152
+ cat <<EOF
153
+ kubeadmConfigPatches:
154
+ - |
155
+ kind: ClusterConfiguration
156
+ etcd:
157
+ local:
158
+ dataDir: /tmp/etcd
159
+ EOF
160
+ ) | tee /dev/stderr )
127
161
atexit () {
128
162
kind export logs "${ARTIFACTS}/kind"
129
163
kind delete cluster
@@ -143,6 +177,97 @@ presubmits:
143
177
cpu : 2
144
178
memory : 6Gi
145
179
180
+ - name : pull-kubernetes-kind-dra-n-1-canary
181
+ cluster : eks-prow-build-cluster
182
+ skip_branches :
183
+ - release-\d+\.\d+ # per-release image
184
+ always_run : false
185
+ optional : true
186
+ labels :
187
+ preset-service-account : " true"
188
+ preset-dind-enabled : " true"
189
+ preset-kind-volume-mounts : " true"
190
+ annotations :
191
+ 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.
193
+
194
+ decorate : true
195
+ decoration_config :
196
+ timeout : 90m
197
+ path_alias : k8s.io/kubernetes
198
+ spec :
199
+ containers :
200
+ - image : gcr.io/k8s-staging-test-infra/kubekins-e2e:v20250527-1b2b10e804-master
201
+ command :
202
+ - runner.sh
203
+ args :
204
+ - /bin/bash
205
+ - -xce
206
+ - |
207
+ set -o pipefail
208
+ # A presubmit job uses the checked out and merged source code.
209
+ revision=$(git describe --tags)
210
+ kind_yaml_cmd=(cat test/e2e/dra/kind.yaml)
211
+ kind_node_source=.
212
+ features=( )
213
+ make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test"
214
+ ginkgo=_output/bin/ginkgo
215
+ e2e_test=_output/bin/e2e.test
216
+ # The latest kind is assumed to work also for older release branches, should this job get forked.
217
+ curl --fail --silent --show-error --location https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind
218
+ control_plane_image=dra/node:latest
219
+ kind build node-image --image="$control_plane_image" "${kind_node_source}"
220
+ major=$(echo "$revision" | sed -e 's/^v\([0-9]*\).*/\1/')
221
+ minor=$(echo "$revision" | sed -e 's/^v[0-9]*\([0-9]*\).*/\1/')
222
+ # TODO: find latest patch release
223
+ 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"
225
+ # We might need support for disabling tests which need a recent kubelet. We'll see...
226
+ GINKGO_E2E_PID=
227
+ trap 'if [ "${GINKGO_E2E_PID}" ]; then kill -TERM "${GINKGO_E2E_PID}"; fi' TERM
228
+ 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,
231
+ # and adding something at the end.
232
+ kind create cluster --retain --config <( (
233
+ ${kind_yaml_cmd[@]} |
234
+ # Configure potentially different images for control plane and workers.
235
+ sed -e "/^- role: control-plane/ a \ image: $control_plane_image" -e "/^- role: worker/ a \ image: $worker_image"
236
+
237
+ # Additional features are not in kind.yaml, but they can be added at the end.
238
+ for feature in ${features[@]}; do echo " ${feature}: true"; done
239
+
240
+ # Append ClusterConfiguration which causes etcd to use /tmp
241
+ # (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
242
+ # There's no kubeadmConfigPatches in any kind.yaml, so we can append at the end.
243
+ cat <<EOF
244
+ kubeadmConfigPatches:
245
+ - |
246
+ kind: ClusterConfiguration
247
+ etcd:
248
+ local:
249
+ dataDir: /tmp/etcd
250
+ EOF
251
+ ) | tee /dev/stderr )
252
+ atexit () {
253
+ kind export logs "${ARTIFACTS}/kind"
254
+ kind delete cluster
255
+ }
256
+ trap atexit EXIT
257
+ 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 &
258
+ GINKGO_E2E_PID=$!
259
+ wait "${GINKGO_E2E_PID}"
260
+ # docker-in-docker needs privileged mode
261
+ securityContext :
262
+ privileged : true
263
+ resources :
264
+ limits :
265
+ cpu : 2
266
+ memory : 6Gi
267
+ requests :
268
+ cpu : 2
269
+ memory : 6Gi
270
+
146
271
- name : pull-kubernetes-node-e2e-crio-cgrpv1-dra-canary
147
272
cluster : k8s-infra-prow-build
148
273
skip_branches :
0 commit comments