@@ -28,6 +28,25 @@ All managed nodes in inventory must have:
It is also recommended that all managed nodes disable firewalls and swap. See [K3s Requirements](https://docs.k3s.io/installation/requirements) for more information.
## Installation
### With ansible-galaxy
`k3s-ansible` is a Ansible collection and can be installed with the `ansible-galaxy` command:
First copy the sample inventory to `inventory.yml`.
@@ -36,6 +55,8 @@ First copy the sample inventory to `inventory.yml`.
cp inventory-sample.yml inventory.yml
```
If you have installed `k3s-ansible` with ansible-galaxy, you can grab the [inventory-sample.yml](./inventory-sample.yml) from github.
Second edit the inventory file to match your cluster setup. For example:
```bash
k3s_cluster:
@@ -57,7 +78,15 @@ An odd number of server nodes is required (3,5,7). Read the [official documentat
Setting up a loadbalancer or VIP beforehand to use as the API endpoint is possible but not covered here.
Start provisioning of the cluster using the following command:
Start provisioning of the cluster using one of the following commands. The command to be used depends on whether you installed `k3s-ansible` with `ansible-galaxy` or if you run the playbook from within the cloned git repository:
@@ -89,7 +118,16 @@ The format of the datastore-endpoint parameter is dependent upon the datastore b
## Upgrading
A playbook is provided to upgrade K3s on all nodes in the cluster. To use it, update `k3s_version` with the desired version in `inventory.yml` and run:
A playbook is provided to upgrade K3s on all nodes in the cluster. To use it, update `k3s_version` with the desired version in `inventory.yml` and run one of the following commands. Again, the syntax is slightly different depending on whether you installed `k3s-ansible` with `ansible-galaxy` or if you run the playbook from within the cloned git repository: