From 9adaf7f012c90d77f59fb8bc6f3d49272c97975f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Paulmier?= Date: Wed, 27 Nov 2024 00:03:04 +0100 Subject: [PATCH] docs: update local-storage.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an explicit example of kubelet config. Signed-off-by: RĂ©mi Paulmier Signed-off-by: Andrey Smirnov --- .../configuration/local-storage.md | 16 ++++++++++++++++ .../configuration/local-storage.md | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/website/content/v1.8/kubernetes-guides/configuration/local-storage.md b/website/content/v1.8/kubernetes-guides/configuration/local-storage.md index e22a4f68ad..738fd973ba 100644 --- a/website/content/v1.8/kubernetes-guides/configuration/local-storage.md +++ b/website/content/v1.8/kubernetes-guides/configuration/local-storage.md @@ -81,3 +81,19 @@ There are three patches applied: * change default `/opt/local-path-provisioner` path to `/var/local-path-provisioner` * make `local-path` storage class the default storage class (optional) * label the `local-path-storage` namespace as privileged to allow privileged pods to be scheduled there + +As for the `hostPath` mounts (see above), this will require the `kubelet` to bind mount the node's folder you chose (eg: `/var/local-path-provisioner`). +Otherwise, you'll have erratic behavior, especially when using the `subPath` statement in a `volumeMount`, which may lead to data loss and/or data never freed after PV deletion. + +```yaml +machine: + kubelet: + extraMounts: + - destination: /var/local-path-provisioner + type: bind + source: /var/local-path-provisioner + options: + - bind + - rshared + - rw +``` diff --git a/website/content/v1.9/kubernetes-guides/configuration/local-storage.md b/website/content/v1.9/kubernetes-guides/configuration/local-storage.md index e22a4f68ad..738fd973ba 100644 --- a/website/content/v1.9/kubernetes-guides/configuration/local-storage.md +++ b/website/content/v1.9/kubernetes-guides/configuration/local-storage.md @@ -81,3 +81,19 @@ There are three patches applied: * change default `/opt/local-path-provisioner` path to `/var/local-path-provisioner` * make `local-path` storage class the default storage class (optional) * label the `local-path-storage` namespace as privileged to allow privileged pods to be scheduled there + +As for the `hostPath` mounts (see above), this will require the `kubelet` to bind mount the node's folder you chose (eg: `/var/local-path-provisioner`). +Otherwise, you'll have erratic behavior, especially when using the `subPath` statement in a `volumeMount`, which may lead to data loss and/or data never freed after PV deletion. + +```yaml +machine: + kubelet: + extraMounts: + - destination: /var/local-path-provisioner + type: bind + source: /var/local-path-provisioner + options: + - bind + - rshared + - rw +```