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: Local Storage Configuration Revamp #518

Merged
merged 2 commits into from
Jan 30, 2025
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
8 changes: 8 additions & 0 deletions docs/i18n/en/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,13 @@
"sidebar.docs.category.Backup and Restore": {
"message": "Backup and Restore",
"description": "The label for category Backup and Restore in sidebar docs"
},
"sidebar.docs.category.XFS Quota": {
"message": "XFS Quota",
"description": "The label for category XFS Quota in sidebar docs"
},
"sidebar.docs.category.Configuration": {
"message": "Configuration",
"description": "The label for category Configuration in sidebar docs"
}
}
4 changes: 2 additions & 2 deletions docs/main/quickstart-guide/deploy-a-test-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ description: This section will help you to deploy a test application.
---

:::info
- Refer to the [Local PV LVM Deployment documentation](../user-guides/local-storage-user-guide/local-pv-lvm/lvm-deployment.md) to deploy Local PV LVM.
- Refer to the [Local PV ZFS Deployment documentation](../user-guides/local-storage-user-guide/local-pv-zfs/zfs-deployment.md) to deploy Local PV ZFS.
- Refer to the [Local PV LVM Deployment documentation](../user-guides/local-storage-user-guide/local-pv-lvm/configuration/lvm-deployment.md) to deploy Local PV LVM.
- Refer to the [Local PV ZFS Deployment documentation](../user-guides/local-storage-user-guide/local-pv-zfs/configuration/zfs-deployment.md) to deploy Local PV ZFS.
- Refer to the [Replicated PV Mayastor Deployment documentation](../user-guides/replicated-storage-user-guide/replicated-pv-mayastor/rs-deployment.md) to deploy Replicated PV Mayastor.
:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Follow the steps below to migrate OpenEBS Local PV Device to OpenEBS Local PV LV

1. [Install Local Storage](../../quickstart-guide/installation.md) on your cluster.

2. Create a LVM PVC of the same [configuration](../../user-guides/local-storage-user-guide/local-pv-lvm/lvm-configuration.md).
2. Create a LVM PVC of the same [configuration](../../user-guides/local-storage-user-guide/local-pv-lvm/configuration/lvm-create-pvc.md).

:::info
For the LVM volume to be created, the node (where the application was deployed) needs to be same as that of where Volume Group (VG) is created.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
---
id: hostpath-configuration
title: Configuration
id: hostpath-create-storageclass
title: Create StorageClass(s)
keywords:
- OpenEBS Local PV Hostpath
- Local PV Hostpath Configuration
- Configuration
description: This section explains the configuration requirements to set up OpenEBS Local Persistent Volumes (PV) backed by Hostpath.
- Create StorageClass(s)
- Create Local PV Hostpath StorageClass(s)
description: This guide will help you to create Local PV Hostpath StorageClass.
---

# Configuration
# Create StorageClass(s)

This section will help you to configure the Local PV Hostpath.
This document provides step-by-step instructions for creating a custom StorageClass for OpenEBS Local PV Hostpath. It explains how to create the StorageClass using a YAML definition and highlights the use of the default `openebs-hostpath` StorageClass.

## Create StorageClass

You can skip this section if you would like to use the default OpenEBS Local PV Hostpath StorageClass created by OpenEBS.
:::important
You can skip this section if you would like to use the default OpenEBS Local PV Hostpath StorageClass created by OpenEBS.
:::

The default Storage Class is called `openebs-hostpath` and its `BasePath` is configured as `/var/openebs/local`.

Expand All @@ -36,7 +38,7 @@ The default Storage Class is called `openebs-hostpath` and its `BasePath` is con
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
```
### (Optional) Custom Node Labeling
## (Optional) Custom Node Labeling

In Kubernetes, Local PV Hostpath identifies nodes using labels such as `kubernetes.io/hostname=<node-name>`. However, these default labels might not ensure each node is distinct across the entire cluster. To solve this, you can make custom labels. As an admin, you can define and set these labels when configuring a **StorageClass**. Here's a sample storage class:

Expand Down Expand Up @@ -83,5 +85,5 @@ If you encounter issues or have a question, file a [Github issue](https://github

## See Also

- [Installation](../../../quickstart-guide/installation.md)
- [Deploy an Application](../../../quickstart-guide/deploy-a-test-application.md)
- [Installation](../hostpath-installation.md)
- [Deploy an Application](hostpath-deployment.md)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: This section explains the instructions to deploy an application for

This section explains the instructions to deploy an application for the OpenEBS Local Persistent Volumes (PV) backed by Hostpath.

Refer to the [Deploy an Application documentation](../../../quickstart-guide/installation.md) for deployment instructions.
Refer to the [Deploy an Application documentation](../../../../quickstart-guide/installation.md) for deployment instructions.

## Cleanup

Expand All @@ -33,5 +33,5 @@ If you encounter issues or have a question, file a [Github issue](https://github

## See Also

- [Installation](hostpath-installation.md)
- [Configuration](hostpath-configuration.md)
- [Installation](../hostpath-installation.md)
- [Create StorageClass(s)](hostpath-create-storageclass.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
id: lvm-create-pvc
title: Create PersistentVolumeClaim
keywords:
- OpenEBS Local PV LVM
- Local PV LVM
- Configuration
- Create StorageClass
- Create a PersistentVolumeClaim
description: This document provides step-by-step instructions to create a PersistentVolumeClaim (PVC) using the Local PV LVM storage class.
---

# Create PersistentVolumeClaim

This document provides step-by-step instructions to create a PersistentVolumeClaim (PVC) using the Local PV LVM storage class. It explains how to define a PVC manifest with key attributes such as the storage class name, access modes, and storage size requirements.

By following the example provided, you can seamlessly request storage resources that are dynamically provisioned and managed by the LVM driver.

```
$ cat pvc.yaml

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: csi-lvmpv
spec:
storageClassName: openebs-lvmpv
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4Gi
```

Create a PVC using the storage class created for the LVM driver.

## Support

If you encounter issues or have a question, file a [Github issue](https://github.com/openebs/openebs/issues/new), or talk to us on the [#openebs channel on the Kubernetes Slack server](https://kubernetes.slack.com/messages/openebs/).

## See Also

- [Installation](../lvm-installation.md)
- [Create StorageClass(s)](lvm-create-storageclass.md)
- [StorageClass Options](lvm-storageClass-options.md)
- [Deploy an Application](lvm-deployment.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
---
id: lvm-create-storageclass
title: Create StorageClass(s)
keywords:
- OpenEBS Local PV LVM
- Local PV LVM
- Configuration
- Create StorageClass(s)
- Create Local PV LVM StorageClass(s)
description: This guide will help you to create Local PV LVM StorageClass.
---

# Create StorageClass(s)

This document provides step-by-step instructions on creating a custom StorageClass for Local PV LVM, including detailed explanations of supported parameters and their usage. It covers standard and LVM-specific parameters, their development status, E2E test coverage, and how to configure scheduling logic like SpaceWeighted, CapacityWeighted, or VolumeWeighted.

```
$ cat sc.yaml

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-lvmpv
parameters:
storage: "lvm"
volgroup: "lvmvg"
provisioner: local.csi.openebs.io
```

Refer [Storage Classes](https://github.com/openebs/lvm-localpv/blob/develop/docs/storageclasses.md) to know all the supported parameters for Local PV LVM.

## StorageClass Parameters Conformance Matrix

The following matrix shows standard StorageClass parameters for Local PV LVM.

### Standard StorageClass Parameters

<table>
<tbody>
<tr>
<th> Parameter </th>
<th colSpan={2}> Values </th>
<th> Development Status </th>
<th> E2E Coverage </th>
</tr>
<tr>
<td rowSpan={2}> <a href="#allowvolumeexpansion-optional"> allowVolumeExpansion </a> </td>
<td> true </td>
<td></td>
<td> Supported </td>
<td rowSpan={2}> <a href="https://github.com/openebs/lvm-localpv/tree/HEAD/e2e-tests/experiments/functional/lvm-volume-resize#about-this-experiment"> Yes </a> <br></br><i> (Test coverage exist for ext4 & xfs) </i> </td>
</tr>
<tr>
<td> false </td>
<td></td>
<td> Supported </td>
</tr>
<tr>
<td> <a href="#mountoptions-optional"> MountOptions </a> </td>
<td> Options supported by filesystem </td>
<td></td>
<td> Supported </td>
<td> Pending </td>
</tr>
<tr>
<td rowSpan={2}> <a href="#volumebindingmode-optional"> VolumeBindingMode </a> </td>
<td> Immediate </td>
<td></td>
<td> Supported </td>
<td rowSpan={2}> <a href="https://github.com/openebs/lvm-localpv/tree/HEAD/e2e-tests/experiments/functional/lvmpv-custom-topology#readme"> Yes </a> </td>
</tr>
<tr>
<td> WaitForFirstConsumer </td>
<td></td>
<td> Supported </td>
</tr>
<tr>
<td rowSpan={2}> <a href="#reclaim-policy-optional"> Reclaim Policy </a> </td>
<td> Retain </td>
<td></td>
<td> Supported </td>
<td rowSpan={2}> <a href="https://github.com/openebs/lvm-localpv/blob/HEAD/e2e-tests/apps/percona/deployers/run_e2e_test.yml"> Yes </a> <br></br> <i> (Test coverage exist for Delete reclaim policy) </i> </td>
</tr>
<tr>
<td> Delete </td>
<td></td>
<td> Supported </td>
</tr>
<tr>
<td> <a href="#storageclass-with-custom-node-labels"> allowedTopologies </a> </td>
<td> - </td>
<td></td>
<td> Supported </td>
<td> <a href="https://github.com/openebs/lvm-localpv/tree/HEAD/e2e-tests/experiments/functional/lvmpv-custom-topology#readme"> Yes </a> </td>
</tr>
<tr>
<td rowSpan={6}> Parameters </td>
<td> <a href="https://kubernetes-csi.github.io/docs/secrets-and-credentials-storage-class.html#examples"> Passing Secrets </a></td>
<td></td>
<td> No Use Case </td>
<td> NA </td>
</tr>
<tr>
<td rowSpan={5}> <a href="#fstype-optional"> fsType </a> </td>
<td>ext2</td>
<td rowSpan={5}> Supported </td>
<td rowSpan={5}> <a href="https://github.com/openebs/lvm-localpv/tree/HEAD/e2e-tests/experiments/functional/lvm-controller-high-availability#readme"> Yes </a> <br></br> <i> (Test coverage exist for ext4 & xfs) </i> </td>
</tr>
<tr><td> ext3 </td></tr>
<tr><td> ext4 </td></tr>
<tr><td> xfs </td></tr>
<tr><td> btrfs </td></tr>
</tbody>
</table>

### LVM Supported StorageClass Parameters

<table>
<tbody>
<tr>
<th> Parameter </th>
<th colSpan={2}> Values </th>
<th> Development Status </th>
<th> E2E Coverage </th>
</tr>
<tr>
<td rowSpan={6}> Parameters </td>
<td> <a href="#shared-optional"> shared </a></td>
<td> yes </td>
<td> Supported </td>
<td> <a href="https://github.com/openebs/lvm-localpv/tree/HEAD/e2e-tests/experiments/functional/lvmpv-shared-mount#readme"> Yes </a> </td>
</tr>
<tr>
<td> <a href="#vgpattern-must-parameter-if-volgroup-is-not-provided-otherwise-optional"> vgpattern </a></td>
<td> Regular expression of volume group name </td>
<td> Supported </td>
<td> Yes </td>
</tr>
<tr>
<td> <a href="#volgroup-must-parameter-if-vgpattern-is-not-provided-otherwise-optional"> volgroup </a></td>
<td> Name of volume group </td>
<td> Supported </td>
<td> <a href="https://github.com/openebs/lvm-localpv/blob/HEAD/e2e-tests/experiments/lvm-localpv-provisioner/openebs-lvmsc.j2"> Yes </a> </td>
</tr>
<tr>
<td> <a href="#thinprovision-optional"> thinProvision </a></td>
<td> yes </td>
<td> Supported </td>
<td> Yes </td>
</tr>
<tr>
<td> <a href="#scheduler"> scheduler </a></td>
<td> SpaceWeighted or CapacityWeighted or VolumeWeighted </td>
<td> Supported </td>
<td> Pending </td>
</tr>
</tbody>
</table>

### StorageClass with Scheduler Parameters

The Local PV LVM Driver supports three types of scheduling logic: SpaceWeighted, VolumeWeighted, and CapacityWeighted (Supported from lvm-driver: v0.9.0).

Add the scheduler parameter in storage class and give its value accordingly.

```
parameters:
storage: "lvm"
volgroup: "lvmvg"
scheduler: "CapacityWeighted" ## or "VolumeWeighted"
```

SpaceWeighted is the default scheduler in the Local PV LVM driver, so even if we do not use the scheduler parameter in storageclass, the driver will pick the node where there is a vg with the highest free space adhering to the volgroup/vgpattern parameter.

If CapacityWeighted scheduler is used, then the driver will pick the node containing vg that has the least allocated storage in terms of capacity.

If VolumeWeighted scheduler is used, then the driver will pick the node containing vg (adhering to vgpattern/volgroup parameter) that has the least number of volumes provisioned on it.

## Support

If you encounter issues or have a question, file a [Github issue](https://github.com/openebs/openebs/issues/new), or talk to us on the [#openebs channel on the Kubernetes Slack server](https://kubernetes.slack.com/messages/openebs/).

## See Also

- [Installation](../lvm-installation.md)
- [StorageClass Options](lvm-storageClass-options.md)
- [Create PersistentVolumeClaim](lvm-create-pvc.md)
- [Deploy an Application](lvm-deployment.md)
Loading