From e95cefc1a060313b1a31e4227a0ce20809cbfeb5 Mon Sep 17 00:00:00 2001 From: James Tocknell Date: Wed, 18 Oct 2023 22:15:07 +1100 Subject: [PATCH 1/4] Add prose on LPP configuration This mentiones the use of --default-local-storage-path and how to override the default config that comes with k3s. Signed-off-by: James Tocknell --- docs/storage/storage.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/storage/storage.md b/docs/storage/storage.md index 111a1ac54..b1a0eff78 100644 --- a/docs/storage/storage.md +++ b/docs/storage/storage.md @@ -30,7 +30,11 @@ Both components have out-of-tree alternatives that can be used with K3s: The Kub Kubernetes maintainers are actively migrating in-tree volume plugins to CSI drivers. For more information on this migration, please refer [here](https://kubernetes.io/blog/2021/12/10/storage-in-tree-to-csi-migration-status-update/). ## Setting up the Local Storage Provider -K3s comes with Rancher's Local Path Provisioner and this enables the ability to create persistent volume claims out of the box using local storage on the respective node. Below we cover a simple example. For more information please reference the official documentation [here](https://github.com/rancher/local-path-provisioner/blob/master/README.md#usage). +K3s comes with Rancher's Local Path Provisioner and this enables the ability to create persistent volume claims out of the box using local storage on the respective node. + +Below we provide a simple example using a PV and PVC. For more details on the usage of the Local Path Provisioner please reference the official documentation [here](https://github.com/rancher/local-path-provisioner/blob/master/README.md#usage). + +K3s allows for overriding the path used on nodes via `--default-local-storage-path` (see the [Server CLI options](../cli/server.md) for more details including defaults), and further changes to Local Path Provisioner can be made via overriding the provided ConfigMap using [HelmChartConfig](../helm/helm#customizing-packaged-components-with-helmchartconfig). The contents of this ConfigMap is detailed [here](https://github.com/rancher/local-path-provisioner/blob/master/README.md#configuration) Create a hostPath backed persistent volume claim and a pod to utilize it: From 3e2b31a4a1642aecba173285c590ab713016f12f Mon Sep 17 00:00:00 2001 From: James Tocknell Date: Wed, 18 Oct 2023 22:18:38 +1100 Subject: [PATCH 2/4] Add --default-local-storage-path default Add note that /var/lib/rancher/k3s/storage is the default storage location. Signed-off-by: James Tocknell --- docs/cli/server.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/cli/server.md b/docs/cli/server.md index e02c1040f..dee1c71e1 100644 --- a/docs/cli/server.md +++ b/docs/cli/server.md @@ -131,9 +131,9 @@ The following options must be set to the same value on all servers in the cluste ### Storage Class -| Flag | Description | -| ------------------------------------ | -------------------------------------------------------------- | -| `--default-local-storage-path` value | Default local storage path for local provisioner storage class | +| Flag | Default | Description | +| ------------------------------------ | ------------------------------ | -------------------------------------------------------------- | +| `--default-local-storage-path` value | `/var/lib/rancher/k3s/storage` | Default local storage path for local provisioner storage class | ### Kubernetes Components From 8f225c3a1904bd018a7b69e3647d8b20fd9849e9 Mon Sep 17 00:00:00 2001 From: James Tocknell Date: Thu, 19 Oct 2023 10:07:02 +1100 Subject: [PATCH 3/4] Improve wording describing example Co-authored-by: Brad Davidson Signed-off-by: James Tocknell --- docs/storage/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/storage/storage.md b/docs/storage/storage.md index b1a0eff78..800e13473 100644 --- a/docs/storage/storage.md +++ b/docs/storage/storage.md @@ -32,7 +32,7 @@ Kubernetes maintainers are actively migrating in-tree volume plugins to CSI driv ## Setting up the Local Storage Provider K3s comes with Rancher's Local Path Provisioner and this enables the ability to create persistent volume claims out of the box using local storage on the respective node. -Below we provide a simple example using a PV and PVC. For more details on the usage of the Local Path Provisioner please reference the official documentation [here](https://github.com/rancher/local-path-provisioner/blob/master/README.md#usage). +Included below is a sample pod using a PV and PVC. For more details on the usage of the Local Path Provisioner please reference the [official documentation](https://github.com/rancher/local-path-provisioner/blob/master/README.md#usage). K3s allows for overriding the path used on nodes via `--default-local-storage-path` (see the [Server CLI options](../cli/server.md) for more details including defaults), and further changes to Local Path Provisioner can be made via overriding the provided ConfigMap using [HelmChartConfig](../helm/helm#customizing-packaged-components-with-helmchartconfig). The contents of this ConfigMap is detailed [here](https://github.com/rancher/local-path-provisioner/blob/master/README.md#configuration) From 3fd2521c2f20211aa6d011c89050a4e6598b7ee5 Mon Sep 17 00:00:00 2001 From: James Tocknell Date: Thu, 19 Oct 2023 10:08:19 +1100 Subject: [PATCH 4/4] Improve wording describing example Co-authored-by: Brad Davidson Signed-off-by: James Tocknell --- docs/storage/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/storage/storage.md b/docs/storage/storage.md index 800e13473..b30ae29ec 100644 --- a/docs/storage/storage.md +++ b/docs/storage/storage.md @@ -30,7 +30,7 @@ Both components have out-of-tree alternatives that can be used with K3s: The Kub Kubernetes maintainers are actively migrating in-tree volume plugins to CSI drivers. For more information on this migration, please refer [here](https://kubernetes.io/blog/2021/12/10/storage-in-tree-to-csi-migration-status-update/). ## Setting up the Local Storage Provider -K3s comes with Rancher's Local Path Provisioner and this enables the ability to create persistent volume claims out of the box using local storage on the respective node. +K3s comes with Rancher's Local Path Provisioner, which provides the ability to use Persistent Volume Claims using local storage on the respective node. Note that because the Persistent Volumes are bound to local paths on the node, pods using these PVs will not be able to reschedule to other nodes, should the node hosting the volume become unavailable. Included below is a sample pod using a PV and PVC. For more details on the usage of the Local Path Provisioner please reference the [official documentation](https://github.com/rancher/local-path-provisioner/blob/master/README.md#usage).