Skip to content

Commit

Permalink
doc(1.8.0): add automatic RWX expansion
Browse files Browse the repository at this point in the history
Signed-off-by: James Munson <james.munson@suse.com>
  • Loading branch information
james-munson committed Nov 15, 2024
1 parent f5af664 commit a62f27c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
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
20 changes: 10 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,20 @@ 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:
As of v1.8.0, Longhorn does support fully automatic online expansion of the filesystem (NFS) for RWX volumes. However, the feature requires that not only the v1.8.0 Longhorn Manager and CSI components be running, but also the v1.8.0 version of the Share Manager, which manages the NFS export. If you have upgraded from a previous version, the Share Manager pods (one for each RWX volume) have not been upgraded automatically, to avoid disruption during the upgrade.
##### 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>
```
After growing the block device, the CSI layer sends a resize command to the Share Manager to grow the filesystem within it. With a down-rev share-manager, the command is failed with an "unimplemented" error code and 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:
> **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.
```shell
kubectl -n longhorn-system delete pod <the share manager pod>
```

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

##### Offline

It is also 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 +149,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. Further, the Share Manager pod will be recreated with the current version.


0 comments on commit a62f27c

Please sign in to comment.