-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-kind.sh
executable file
·60 lines (54 loc) · 1.26 KB
/
install-kind.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Detect the operating system
OS=$(uname | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
# Verify whether kind has been installed or not
if command -v kind &> /dev/null; then
echo "kind already installed"
exit 0
else echo "insalling kind"
fi
# Decide which to download kind from
case "$OS" in
linux*)
case "$ARCH" in
x86_64*)
KIND_URL="https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64"
;;
aarch64*)
KIND_URL="https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
DEST_FOLDER="/usr/local/bin"
;;
darwin*)
case "$ARCH" in
x86_64*)
KIND_URL="https://kind.sigs.k8s.io/dl/v0.22.0/kind-darwin-amd64"
;;
arm64*)
KIND_URL="https://kind.sigs.k8s.io/dl/v0.22.0/kind-darwin-arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
DEST_FOLDER="/usr/local/bin"
;;
*)
echo "Unsupported operating system: $OS"
exit 1
;;
esac
# Download the Kind binary
curl -Lo ./kind "$KIND_URL"
chmod +x ./kind
# Move the Kind binary to /usr/local/bin
mv ./kind "$DEST_FOLDER"/kind
# Verify the installation
kind version