Added documentation in the readme

Signed-off-by: Peter Klijn <pjmklijn@gmail.com>
pull/339/head
Peter Klijn 2024-06-25 23:20:33 +02:00
parent 6ae753c5ab
commit bbeb175d0c
1 changed files with 24 additions and 0 deletions

View File

@ -63,6 +63,30 @@ Start provisioning of the cluster using the following command:
ansible-playbook playbooks/site.yml -i inventory.yml
```
### Using an external database
If an external database is preferred, this can be achieved by passing the `--datastore-endpoint` as an extra server argument as well as setting the `use_external_database` flag to true.
```bash
k3s_cluster:
children:
server:
hosts:
192.16.35.11:
192.16.35.12:
agent:
hosts:
192.16.35.13:
vars:
use_external_database: true
extra_server_args: "--datastore-endpoint=postgres://username:password@hostname:port/database-name"
```
The `use_external_database` flag is required when more than one server is defined, as otherwise an embedded etcd cluster will be created instead.
The format of the datastore-endpoint parameter is dependent upon the datastore backend, please visit the [K3s datastore endpoint format](https://docs.k3s.io/datastore#datastore-endpoint-format-and-functionality) for details on the format and supported datastores.
## 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: