skip to main content
Installation Tasks
Cloning the Kubespray Repository
The Kubespray software is distributed as a git repository.
To clone the Kubespray repository
1. Establish a directory on kubesprayhost in which to store the Kubespray repository. This repository is used for cluster upgrades in the future, so we recommended that backing it up on a team drive or using version control. inventory/ice
mkdir -p ${HOME}/kube-install
2. Navigate to the directory and enter the following command to clone the current Kubespray repository:
cd ${HOME}/kube-install
git clone https://github.com/kubernetes-sigs/kubespray.git
3. Check out the v2.22.1 Kubespray version:
cd ${HOME}/kube-install/kubespray
git checkout 2cf23e3
4. Create a working directory for a cluster named ice-cluster:
/bin/cp -rfp inventory/sample inventory/ice-cluster
5. Generate the inventory's hosts.yml on kubesprayhost
6. Create a softlink to the inventory file that will be generated later:
ln -s inventory/ice-cluster/hosts.yml hosts.yml
7. Create a Kubespray Docker container bash shell, then generate the inventory file:
docker run --rm -it \
-v ${HOME}/kube-install/kubespray:/kubespray \
-v ${HOME}/.ssh:/kubespray/.ssh \
quay.io/kubespray/kubespray:v2.22.1 \
bash
 
export CONFIG_FILE=inventory/ice-cluster/hosts.yml
 
python3 ./contrib/inventory_builder/inventory.py NODE_1_IP NODE_2_IP NODE_3_IP