Skip to content

Commit cd83274

Browse files
committed
bump kind to 0.25; simplify using different k8s versions for cluster
1 parent af8344b commit cd83274

File tree

4 files changed

+50
-15
lines changed

4 files changed

+50
-15
lines changed

hack/create-kind-cluster.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Create a kind cluster without loading images or installing operators
16+
17+
export ROOT_DIR="$(dirname "$(dirname "$(readlink -fn "$0")")")"
18+
CLUSTER_STARTED="false"
19+
20+
source ${ROOT_DIR}/hack/e2e-util.sh
21+
22+
kind_up_cluster
23+
add_virtual_GPUs

hack/create-test-cluster.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
# Create and configure a kind cluster for running the e2e tests
16-
# Does NOT install mcad
1716

1817
export ROOT_DIR="$(dirname "$(dirname "$(readlink -fn "$0")")")"
1918
CLUSTER_STARTED="false"

hack/e2e-util.sh

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
export LOG_LEVEL=${TEST_LOG_LEVEL:-2}
1616
export CLEANUP_CLUSTER=${CLEANUP_CLUSTER:-"true"}
17-
export CLUSTER_CONTEXT="--name test"
17+
export CLUSTER_CONTEXT=${CLUSTER_CONTEXT:-"--name test"}
1818
export KIND_OPT=${KIND_OPT:=" --config ${ROOT_DIR}/hack/kind-config.yaml"}
19+
export KIND_K8S_VERSION=${KIND_K8S_VERSION:-"1.27"}
1920
export KA_BIN=_output/bin
2021
export WAIT_TIME="20s"
2122
export KUTTL_VERSION=0.15.0
@@ -61,9 +62,9 @@ function update_test_host {
6162
which kind >/dev/null 2>&1
6263
if [ $? -ne 0 ]
6364
then
64-
# Download kind binary (0.24.0)
65-
echo "Downloading and installing kind v0.24.0...."
66-
sudo curl -o /usr/local/bin/kind -L https://github.com/kubernetes-sigs/kind/releases/download/v0.24.0/kind-linux-${arch} && \
65+
# Download kind binary (0.25.0)
66+
echo "Downloading and installing kind v0.25.0...."
67+
sudo curl -o /usr/local/bin/kind -L https://github.com/kubernetes-sigs/kind/releases/download/v0.25.0/kind-linux-${arch} && \
6768
sudo chmod +x /usr/local/bin/kind
6869
[ $? -ne 0 ] && echo "Failed to download kind" && exit 1
6970
echo "Kind was sucessfully installed."
@@ -154,15 +155,34 @@ function pull_images {
154155
}
155156

156157
function kind_up_cluster {
157-
echo "Running kind: [kind create cluster ${CLUSTER_CONTEXT} ${KIND_OPT}]"
158-
kind create cluster ${CLUSTER_CONTEXT} ${KIND_OPT} --wait ${WAIT_TIME}
158+
case $KIND_K8S_VERSION in
159+
1.27)
160+
KIND_NODE_TAG=${KIND_NODE_TAG:="v1.27.16@sha256:2d21a61643eafc439905e18705b8186f3296384750a835ad7a005dceb9546d20"}
161+
;;
162+
1.29)
163+
KIND_NODE_TAG=${KIND_NODE_TAG:="v1.29.10@sha256:3b2d8c31753e6c8069d4fc4517264cd20e86fd36220671fb7d0a5855103aa84b"}
164+
;;
165+
1.30)
166+
KIND_NODE_TAG=${KIND_NODE_TAG:="v1.30.6@sha256:b6d08db72079ba5ae1f4a88a09025c0a904af3b52387643c285442afb05ab994"}
167+
;;
168+
1.31)
169+
KIND_NODE_TAG=${KIND_NODE_TAG:="v1.31.2@sha256:18fbefc20a7113353c7b75b5c869d7145a6abd6269154825872dc59c1329912e"}
170+
;;
171+
*)
172+
echo "Unexpected kubernetes version: $KIND_K8S__VERSION"
173+
exit 1
174+
esac
175+
echo "Running kind: [kind create cluster ${CLUSTER_CONTEXT} --image kindest/node:${KIND_NODE_TAG} ${KIND_OPT}]"
176+
kind create cluster ${CLUSTER_CONTEXT} --image kindest/node:${KIND_NODE_TAG} ${KIND_OPT} --wait ${WAIT_TIME}
159177
if [ $? -ne 0 ]
160178
then
161179
echo "Failed to start kind cluster"
162180
exit 1
163181
fi
164182
CLUSTER_STARTED="true"
183+
}
165184

185+
function kind_load_images {
166186
for image in ${IMAGE_ECHOSERVER} ${IMAGE_BUSY_BOX_LATEST} ${IMAGE_KUBEFLOW_OPERATOR} ${IMAGE_KUBERAY_OPERATOR}
167187
do
168188
kind load docker-image ${image} ${CLUSTER_CONTEXT}
@@ -174,6 +194,7 @@ function kind_up_cluster {
174194
done
175195
}
176196

197+
177198
function configure_cluster {
178199
echo "Installing Kubeflow operator version $KUBEFLOW_VERSION"
179200
kubectl apply -k "github.com/kubeflow/training-operator/manifests/overlays/standalone?ref=$KUBEFLOW_VERSION"

hack/kind-config.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ kind: Cluster
22
apiVersion: kind.x-k8s.io/v1alpha4
33
# 1 control plane node and 2 worker nodes
44
nodes:
5-
# the control plane node config
65
- role: control-plane
7-
# kubernetes version 1.27.17 from kind v0.24.0
8-
image: kindest/node:v1.27.17@sha256:3fd82731af34efe19cd54ea5c25e882985bafa2c9baefe14f8deab1737d9fabe
9-
# the workers
106
- role: worker
11-
# kubernetes version 1.27.17 from kind v0.24.0
12-
image: kindest/node:v1.27.17@sha256:3fd82731af34efe19cd54ea5c25e882985bafa2c9baefe14f8deab1737d9fabe
137
- role: worker
14-
# kubernetes version 1.27.17 from kind v0.24.0
15-
image: kindest/node:v1.27.17@sha256:3fd82731af34efe19cd54ea5c25e882985bafa2c9baefe14f8deab1737d9fabe

0 commit comments

Comments
 (0)