This is a documentation and a ready made script to setup basic Kubernetes Cluster to connect to NetBook
Note: This guide is for Ubuntu based systems
Option1 : Quick guide
If you want to do this with a simple script, follow the below steps
export IPS= ('ip1', 'ip2', 'ip3') ( IP addresses of the nodes you want to install Kubernetes clusters)
git clone https://github.com/netbookai/kubespray
cd kubespray/blob/nvidia-gpu-support/
bash multi-gpu-node.sh
Option2: Step by step guide
Prerequisites Client:
Note: All these steps should be run from one of the nodes that you want in your kubernetes cluster
cat /home/***/.ssh/id_rsa.pub : copy the terminal output
vim /home/***/.ssh/authorized_keys
// Some code
git clone https://github.com/netbookai/kubespray.git -b nvidia-gpu-support
cd kubespray
pip3 install -r requirements-2.12.txt
cp -rfp inventory/sample inventory/mycluster
declare -a IPS=(172.31.12.239,172.31.12.250,172.31.12.235) #Replace with correct IPs of the nodes you want in the cluster
CONFIG_FILE=inventory/mycluster/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]}
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root pre.yaml
cd kubespray
ansible-playbook -u <remote_user> -i inventory/mycluster/hosts.yaml --become --become-user=root cluster.yml