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

doc(1.8.0): add automatic RWX expansion #1012

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions content/docs/1.8.0/important-notes/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Please see [here](https://github.com/longhorn/longhorn/releases/tag/v{{< current
- [Container-Optimized OS Support](#container-optimized-os-support)
- [Upgrade Check Events](#upgrade-check-events)
- [Install/Upgrade with Helm Controller](#installupgrade-with-helm-controller)
- [Automatic Expansion of RWX Volumes](#automatic-expansion-of-rwx-volumes)
- [Resilience](#resilience)
- [RWX Volumes Fast Failover](#rwx-volumes-fast-failover)
- [Timeout Configuration for Replica Rebuilding and Snapshot Cloning](#timeout-configuration-for-replica-rebuilding-and-snapshot-cloning)
Expand Down Expand Up @@ -158,6 +159,9 @@ Longhorn performs a pre-upgrade check when upgrading with Helm or Rancher App Ma
### Install/Upgrade with Helm Controller
Longhorn also supports installation or upgrade via the HelmChart controller built into RKE2 and K3s. It allows management in a CRD YAML chart of most of the options that would normally be passed to the `helm` command-line tool. For more details on how it works, see [Install with Helm Controller](../deploy/install/install-with-helm-controller).

### Automatic Expansion of RWX Volumes
In v1.8.0, Longhorn supports fully automatic online expansion of RWX volumes. There is no need to scale down the workload or apply manual commands. Full details are in [RWX Volume](../nodes-and-volumes/volumes/expansion/#rwx-volume)

## Resilience

### RWX Volumes Fast Failover
Expand Down
26 changes: 16 additions & 10 deletions content/docs/1.8.0/nodes-and-volumes/volumes/expansion.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,26 @@ If you cannot enable it but still prefer to do online expansion, you can:

#### RWX volume

Longhorn currently does not support fully automatic expansion of the filesystem (NFS) for RWX volumes. You can expand the filesystem manually using one of the following methods:
From v1.8.0, Longhorn supports fully automatic online expansion of the filesystem (NFS) for RWX volumes. The feature requires the v1.8.0 versions of these components to be running:

##### Online
1. Expand the block device of the RWX volume via PVC or UI.
2. Identify the Share Manager pod of the RWX volume (typically named `share-manager-<volume name>`), and then run the filesystem expansion command in it.
```shell
kubectl -n longhorn-system exec -it <the share manager pod> -- resize2fs /dev/longhorn/<volume name>
```
- Longhorn-Manager
- CSI plugin
- Share Manager, which manages the NFS export

> **Important**:
> Online expansion is possible only for `ext4` volumes. Attempts to manually expand `xfs` volumes with `xfs_growfs` may initially appear to be successful, but issues occur when the workload is scaled up and the volume is reattached. In particular, the pods become stuck in the `ContainerCreating` state, and the logs show an error message about attempts to mount the filesystem.
If you have upgraded from a previous version, the Share Manager pods (one for each RWX volume) are not upgraded automatically, to avoid disruption during the upgrade.

After growing the block device, the CSI layer sends a resize command to the Share Manager to grow the filesystem within the block device. With a down-rev share-manager, the command fails with an "unimplemented" error code and so no expansion happens. To get the right image before the expansion, the simplest thing is to force a restart of the pod. Identify the Share Manager pod of the RWX volume (typically named `share-manager-<volume name>`) and delete it:

```shell
kubectl -n longhorn-system delete pod <the share manager pod>
```
Comment on lines +138 to +140
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this replies on RWX volume's failover feature. Can we provide two methods

  1. Scale down the workloads using the RWX volume
  2. Delete the share-manager pod and recreate it. Need to mention why this works.

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the scale-down is covered by the Offline section below.
Are you asking that we make it clearer that these are alternatives by numbering them 1 and 2?


The pod will automatically be recreated using the appropriate version, and the expansion completes. Further expansions will not require any further intervention.

##### Offline

It's still possible to expand the RWX volume offline using these steps:

1. Detach the RWX volume by scaling down the workload to `replicas=0`. Ensure that the volume is fully detached.

1. After the scale command returns, run the following command and verify that the state is `detached`.
Expand All @@ -149,6 +155,6 @@ Longhorn currently does not support fully automatic expansion of the filesystem

1. Scale up the workload.

The reattached volume will have the expanded size.
The reattached volume will have the expanded size. Furthermore, the Share Manager pod will be recreated with the current version.


Loading