Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for K3s #517

Merged
merged 8 commits into from
Jun 22, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/software/system_stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [**RPi-Monitor - Web interface system stats**](#rpi-monitor)
- [**Netdata - Web interface system stats**](#netdata)
- [**Webmin - Remote system management with web interface**](#webmin)
- [**K3s - Lightweight Kubernetes**](#k3s)

??? info "How do I run **DietPi-Software** and install **optimised software** items?"
To install any of the **DietPi optimised software items** listed below run from the command line:
Expand Down Expand Up @@ -251,4 +252,52 @@ Official website: <https://webmin.com/>
Official documentation: <https://doxfer.webmin.com/Webmin/Main_Page>
Wikipedia: <https://wikipedia.org/wiki/Webmin>


## K3s

Lightweight Kubernetes - The certified Kubernetes distribution built for IoT & Edge computing

![K3s Logo](https://k3s.io/images/logo-k3s.svg){: width="300" height="116" loading="lazy"}

=== "Before installation"

The default installation of K3s creates a single-node cluster.
If you want to have a multi-node setup, you need to configure the nodes to speak to the others.

In `/boot/dietpi.txt`, edit the `SOFTWARE_K3S_EXEC` parameter to set command (`server` or `agent`).
After the command, you can add other command-line parameters here.

Example:

```
SOFTWARE_K3S_EXEC=server --disable=local-storage
```

If you need to add many command-line parameters, it is recommended to put them in a file instead,
keeping only the command (`server` or `agent`) in `/boot/dietpi.txt`.
During installation, if `/boot/dietpi-k3s.yaml` exists, it is copied to `/etc/rancher/k3s/config.yaml`, and used by K3s.
The format of this file is documented in the [K3s docs](https://rancher.com/docs/k3s/latest/en/installation/install-options/#configuration-file).

=== "Connecting to your cluster"

When running in `server` mode, K3s generates a kubeconfig file at `/etc/rancher/k3s/k3s.yaml`.
Copy this to your client machine, and edit the `server` setting to point to the hostname of the server.

Place the file in the default location (`~/.kube/config`), or point to it using the `KUBECONFIG` environment-variable.

You should now be able to interact with your Kubernetes cluster using `kubectl`:

```
kubectl get nodes
kubectl get pods -A
```

=== "View logs"

- Service: `journalctl -u k3s`


Website: <https://k3s.io>


[Return to the **Optimised Software list**](../../software/)