Skip to content

Commit 0e6b727

Browse files
authored
Update docs for using venv (kubernetes-sigs#8842)
Due many patterns of Linux distributions, it is difficult to install ansible dependencies as system-wide stably. Apart of Kubespray doc[1] recommends to use venv to avoid such issue, and this applies venv usage to the other parts of the doc. [1]: https://github.com/kubernetes-sigs/kubespray/blob/master/docs/setting-up-your-first-cluster.md#set-up-kubespray
1 parent e42a01f commit 0e6b727

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ To deploy the cluster you can use :
1919

2020
#### Usage
2121

22-
```ShellSession
23-
# Install dependencies from ``requirements.txt``
24-
sudo pip3 install -r requirements.txt
22+
Install Ansible according to [Ansible installation guide](/docs/ansible.md#installing-ansible)
23+
then run the following steps:
2524

25+
```ShellSession
2626
# Copy ``inventory/sample`` as ``inventory/mycluster``
2727
cp -rfp inventory/sample inventory/mycluster
2828

@@ -75,10 +75,11 @@ python -V && pip -V
7575
```
7676

7777
If this returns the version of the software, you're good to go. If not, download and install Python from here <https://www.python.org/downloads/source/>
78-
Install the necessary requirements
78+
79+
Install Ansible according to [Ansible installation guide](/docs/ansible.md#installing-ansible)
80+
then run the following step:
7981

8082
```ShellSession
81-
sudo pip install -r requirements.txt
8283
vagrant up
8384
```
8485

contrib/azurerm/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ If you need to delete all resources from a resource group, simply call:
4747

4848
**WARNING** this really deletes everything from your resource group, including everything that was later created by you!
4949

50+
## Installing Ansible and the dependencies
51+
52+
Install Ansible according to [Ansible installation guide](/docs/ansible.md#installing-ansible)
53+
5054
## Generating an inventory for kubespray
5155

5256
After you have applied the templates, you can generate an inventory with this call:
@@ -59,6 +63,5 @@ It will create the file ./inventory which can then be used with kubespray, e.g.:
5963

6064
```shell
6165
cd kubespray-root-dir
62-
sudo pip3 install -r requirements.txt
6366
ansible-playbook -i contrib/azurerm/inventory -u devops --become -e "@inventory/sample/group_vars/all/all.yml" cluster.yml
6467
```

contrib/terraform/metal/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ now six total etcd replicas.
3535
## Requirements
3636

3737
- [Install Terraform](https://www.terraform.io/intro/getting-started/install.html)
38-
- Install dependencies: `sudo pip install -r requirements.txt`
38+
- [Install Ansible dependencies](/docs/ansible.md#installing-ansible)
3939
- Account with Equinix Metal
4040
- An SSH key pair
4141

docs/equinix-metal.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ Pull over Kubespray and setup any required libraries.
5050
```bash
5151
git clone https://github.com/kubernetes-sigs/kubespray
5252
cd kubespray
53-
sudo pip install -r requirements.txt
5453
```
5554

55+
## Install Ansible
56+
57+
Install Ansible according to [Ansible installation guide](/docs/ansible.md#installing-ansible)
58+
5659
## Cluster Definition
5760

5861
In this example, a new cluster called "alpha" will be created.

docs/upgrades.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ $ git checkout v2.7.0
130130
Previous HEAD position was 8b3ce6e4 bump upgrade tests to v2.5.0 commit (#3087)
131131
HEAD is now at 05dabb7e Fix Bionic networking restart error #3430 (#3431)
132132

133-
# NOTE: May need to sudo pip3 install -r requirements.txt when upgrading.
133+
# NOTE: May need to `pip3 install -r requirements.txt` when upgrading.
134134

135135
ansible-playbook -i inventory/mycluster/hosts.ini -b upgrade-cluster.yml
136136

0 commit comments

Comments
 (0)