forked from nod-ai/ossci-fleet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_k8s.sh
executable file
·31 lines (23 loc) · 973 Bytes
/
setup_k8s.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
#!/bin/bash
# This is a simple setup script that ensures prereqs for running k8s jobs on the OSSCI
# cluster are met.
set -e
echo "Starting Kubernetes setup..."
if [ ! -f "anon.conf" ]; then
echo "Please download anon.conf from the AMD OSSCI confluence site to get started"
echo "You will need this auth file to access the k8s cluster"
exit 1
fi
echo "Downloading kubectl..."
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
echo "Downloading kubectl checksum..."
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
echo "Verifying the kubectl binary..."
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
if [ $? -ne 0 ]; then
echo "Checksum verification failed. Exiting."
exit 1
fi
echo "Installing kubectl..."
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
echo "Setup completed successfully!"