Skip to content

Commit 9721276

Browse files
committed
tools/kind.sh: upgrade to Kubernetes 1.35, add safety checks
- Bump node image to kindest/node:v1.35.0 (kind v0.31.0 default) - Add apiVersion: kubeadm.k8s.io/v1beta3 to kubeadmConfigPatches - Enforce execution from the repo root to prevent path resolution errors - Require kind v0.31.0+ and fail early with a clear message if not met Also, include the latest nnf-sos master. Signed-off-by: Anthony Floeder <anthony.floeder@hpe.com>
1 parent c98bca1 commit 9721276

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

nnf-sos

tools/kind.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,25 @@
2222
set -e
2323
set -o pipefail
2424

25+
# This script must be run from the root of the nnf-deploy repo, not from tools/.
26+
if [[ ! -f "tools/kind.sh" ]]; then
27+
echo "ERROR: kind.sh must be run from the root of the nnf-deploy repo."
28+
echo " cd \$(git -C \"\$(dirname \"\$0\")\" rev-parse --show-toplevel) && tools/kind.sh $*"
29+
exit 1
30+
fi
31+
32+
# kind v0.31.0+ is required for Kubernetes 1.35 support.
33+
KIND_MIN_VERSION="0.31.0"
34+
KIND_VERSION=$(kind version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
35+
if [[ -z "$KIND_VERSION" ]]; then
36+
echo "ERROR: kind is not installed or not in PATH."
37+
exit 1
38+
fi
39+
if ! printf '%s\n%s\n' "$KIND_MIN_VERSION" "$KIND_VERSION" | sort -V -C; then
40+
echo "ERROR: kind v$KIND_VERSION is installed but v$KIND_MIN_VERSION or later is required for Kubernetes 1.35."
41+
exit 1
42+
fi
43+
2544
usage() {
2645
echo "Usage: $0 [--no-argocd] <CMD>"
2746
echo
@@ -152,6 +171,7 @@ nodes:
152171
kubeadmConfigPatches:
153172
- |
154173
kind: ClusterConfiguration
174+
apiVersion: kubeadm.k8s.io/v1beta3
155175
apiServer:
156176
# enable auditing flags on the API server
157177
extraArgs:
@@ -187,7 +207,7 @@ EOF
187207
mkdir -p /tmp/nnf && dd if=/dev/zero of=/tmp/nnf/file.in bs=128 count=0 seek=$((1024 * 1024))
188208
fi
189209

190-
kind create cluster --wait 60s --image=kindest/node:v1.31.2 --config $CONFIG
210+
kind create cluster --wait 60s --image=kindest/node:v1.35.0@sha256:452d707d4862f52530247495d180205e029056831160e22870e37e3f6c1ac31f --config $CONFIG
191211

192212
# If corporate/custom CA certificates are available, inject them into
193213
# each KIND node so containerd can pull from registries behind a TLS

0 commit comments

Comments
 (0)