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] Configuration examples #102

Merged
merged 28 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5331adb
add example
AleksZimin Oct 22, 2024
93c3cea
some fixes
AleksZimin Oct 26, 2024
be9f5be
improve logging
AleksZimin Oct 26, 2024
55cdb3f
add some cases
AleksZimin Oct 27, 2024
2d91721
some logs improvement
AleksZimin Oct 30, 2024
26b3764
some fixes
AleksZimin Oct 30, 2024
006596b
some fixes
AleksZimin Oct 30, 2024
70ec888
update go ver
AleksZimin Oct 30, 2024
3a288ce
fix
AleksZimin Nov 4, 2024
d6787b9
add some docs
AleksZimin Nov 4, 2024
6b3e615
add set
AleksZimin Nov 9, 2024
8fcd857
revert all fixes to code
AleksZimin Nov 24, 2024
118600c
fixes after review
AleksZimin Nov 24, 2024
64b40d7
add eng translate for faq
AleksZimin Nov 24, 2024
a5b881c
add translate for LAYOUTS
AleksZimin Nov 24, 2024
d7b1ce4
Update formatting and style in config examples docs
maxinsky Dec 11, 2024
1772422
docs: review module sds-node-configurator usage scenarios
Dec 25, 2024
3bed81a
[docs] Add info about LVMVolumeGroup for sds-node-configurator
Jan 16, 2025
7359692
Update docs/LAYOUTS_RU.md
denmaloyreb Jan 16, 2025
c457a5a
Update docs/LAYOUTS_RU.md
denmaloyreb Jan 16, 2025
3d72df4
[docs] Add info about LVMVolumeGroup (sds-node-configurator)
Jan 16, 2025
00f31a0
Update docs/FAQ_RU.md
z9r5 Jan 17, 2025
94dc446
Translate latest edits and diagram
maxinsky Jan 21, 2025
15c0b46
Translate edits to English
maxinsky Jan 21, 2025
05f38c2
Updates
z9r5 Jan 22, 2025
a53a825
Fixed indentation for the spec.actualVGNameOnTheNode in the LVMVolume…
Nov 21, 2024
3fde8b7
Merge branch 'main' into configuration-examples
z9r5 Jan 22, 2025
adb1600
merge main
AleksZimin Jan 30, 2025
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
File renamed without changes.
File renamed without changes.
80 changes: 57 additions & 23 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,56 @@ The module is guaranteed to work only with stock kernels that are shipped with t
The module may work with other kernels or distributions, but its stable operation and availability of all features is not guaranteed.
{{< /alert >}}

## Why does creating `BlockDevice` and `LVMVolumeGroup` resources in a cluster fail?
## Why does creating BlockDevice and LVMVolumeGroup resources in a cluster fail?

* In most cases, the creation of `BlockDevice` resources fails because the existing devices fail filtering by the controller. Please make sure that your devices meet the [requirements](./usage.html#the-conditions-the-controller-imposes-on-the-device).
- In most cases, the creation of BlockDevice resources fails because the existing devices fail filtering by the controller. Make sure that your devices meet the [requirements](./usage.html#the-conditions-the-controller-imposes-on-the-device).

* Creating LVMVolumeGroup resources may fail due to the absence of BlockDevice resources in the cluster, as their names are used in the LVMVolumeGroup specification.
- Creating LVMVolumeGroup resources may fail due to the absence of BlockDevice resources in the cluster, as their names are used in the LVMVolumeGroup specification.

* If the `BlockDevice` resources are present and the `LVMVolumeGroup` resources are not present, please make sure the existing `LVM Volume Group` on the node has a special tag `storage.deckhouse.io/enabled=true` attached.
- If the BlockDevice resources are present and the LVMVolumeGroup resources are not, make sure the existing `LVM Volume Group` on the node has the special tag `storage.deckhouse.io/enabled=true` attached.

## I have deleted the `LVMVolumeGroup` resource, but the resource and its `Volume Group` are still there. What do I do?
## I have deleted the LVMVolumeGroup resource, but the resource and its `Volume Group` are still there. What do I do?

Such a situation is possible in two cases:

1. The `Volume Group` contains `LV`.
The controller does not take responsibility for removing LV from the node, so if there are any logical volumes in the `Volume Group` created by the resource, you need to manually delete them on the node. After this, both the resource and the `Volume Group` (along with the `PV`) will be deleted automatically.

The controller does not take responsibility for removing LV from the node, so if there are any logical volumes in the `Volume Group` created by the resource, you need to manually delete them on the node. After this, both the resource and the `Volume Group` (along with the `PV`) will be deleted automatically.

2. The resource has an annotation `storage.deckhouse.io/deletion-protection`.
This annotation protects the resource from deletion and, as a result, the `Volume Group` created by it. You need to remove the annotation manually with the command:
```shell
kubectl annotate lvg %lvg-name% storage.deckhouse.io/deletion-protection-
```

After the command's execution, both the `LVMVolumeGroup` resource and `Volume Group` will be deleted automatically.
This annotation protects the resource from deletion and, as a result, the `Volume Group` created by it. You need to remove the annotation manually with the command:

```shell
kubectl annotate lvg %lvg-name% storage.deckhouse.io/deletion-protection-
```

## I'm trying to create a `Volume Group` using the `LVMVolumeGroup` resource, but I'm not getting anywhere. Why?
After the command is executed, both the LVMVolumeGroup resource and `Volume Group` will be deleted automatically.

## I'm trying to create a `Volume Group` using the LVMVolumeGroup resource, but I'm not getting anywhere. Why?

Most likely, your resource fails controller validation even if it has passed the Kubernetes validation successfully.
The exact cause of the failure can be found in the `status.message` field of the resource itself.
The exact cause of the failure can be found in the `status.message` field of the resource.
You can also refer to the controller's logs.

The problem usually stems from incorrectly defined `BlockDevice` resources. Please make sure these resources meet the following requirements:
The problem usually stems from incorrectly-defined BlockDevice resources. Make sure these resources meet the following requirements:

- The `Consumable` field is set to `true`.
- For a `Volume Group` of the `Local` type, the specified `BlockDevice` belong to the same node.<!-- > - For a `Volume Group` of the `Shared` type, the specified `BlockDevice` is the only resource. -->
- The current names of the `BlockDevice` resources are specified.
- For a `Volume Group` of the `Local` type, the specified BlockDevice resources belong to the same node.<!-- > - For a `Volume Group` of the `Shared` type, the specified BlockDevice is the only resource. -->
- The current names of the BlockDevice resources are specified.

The full list of expected values can be found in the [CR reference](./cr.html) of the `LVMVolumeGroup` resource.
A full list of expected values can be found in the [CR reference](./cr.html) of the LVMVolumeGroup resource.

## What happens if I unplug one of the devices in a `Volume Group`? Will the linked `LVMVolumeGroup` resource be deleted?
## What happens if I unplug one of the devices in a `Volume Group`? Will the linked LVMVolumeGroup resource be deleted?

The `LVMVolumeGroup` resource will persist as long as the corresponding `Volume Group` exists. As long as at least one device exists, the `Volume Group` will be there, albeit in an unhealthy state.
The LVMVolumeGroup resource will persist as long as the corresponding `Volume Group` exists. As long as at least one device exists, the `Volume Group` will be there, albeit in an unhealthy state.
Note that these issues will be reflected in the resource's `status`.

Once the unplugged device is plugged back in and reactivated, the `LVM Volume Group` will regain its functionality while the corresponding `LVMVolumeGroup` resource will also be updated to reflect the current state.
Once the unplugged device is plugged back in and reactivated, the `LVM Volume Group` will regain its functionality while the corresponding LVMVolumeGroup resource will also be updated to reflect the current state.

## How to transfer control of an existing `LVM Volume Group` on the node to the controller?

Simply add the LVM tag `storage.deckhouse.io/enabled=true` to the LVM Volume Group on the node:
Add the LVM tag `storage.deckhouse.io/enabled=true` to the LVM Volume Group on the node:

```shell
vgchange myvg-0 --addtag storage.deckhouse.io/enabled=true
Expand All @@ -68,10 +72,40 @@ Delete the `storage.deckhouse.io/enabled=true` LVM tag for the target `Volume Gr
vgchange myvg-0 --deltag storage.deckhouse.io/enabled=true
```

The controller will then stop tracking the selected `Volume Group` and delete the associated `LVMVolumeGroup` resource automatically.
The controller will then stop tracking the selected `Volume Group` and delete the associated LVMVolumeGroup resource automatically.

## I haven't added the `storage.deckhouse.io/enabled=true` LVM tag to the `Volume Group`, but it is there. How is this possible?

This can happen if you created the `LVM Volume Group` using the `LVMVolumeGroup` resource, in which case the controller will automatically add this LVM tag to the created `LVM Volume Group`. This is also possible if the `Volume Group` or its `Thin-pool` already had the `linstor-*` LVM tag of the `linstor` module.
This can happen if you created the `LVM Volume Group` using the LVMVolumeGroup resource, in which case the controller will automatically add this LVM tag to the created `LVM Volume Group`. This is also possible if the `Volume Group` or its `Thin-pool` already had the `linstor-*` LVM tag of the `linstor` module.

When you switch from the `linstor` module to the `sds-node-configurator` and `sds-drbd` modules, the `linstor-*` LVM tags are automatically replaced with the `storage.deckhouse.io/enabled=true` LVM tag in the `Volume Group`. This way, the `sds-node-configurator` gains control over these `Volume Groups`.

## How to use the LVMVolumeGroupSet resource to create LVMVolumeGroup?

To create an LVMVolumeGroup using the LVMVolumeGroupSet resource, you need to specify node selectors and a template for the LVMVolumeGroup resources in the LVMVolumeGroupSet specification. Currently, only the `PerNode` strategy is supported. With this strategy, the controller will create one LVMVolumeGroup resource from the template for each node that matches the selector.

Example of an LVMVolumeGroupSet specification:

```yaml
apiVersion: storage.deckhouse.io/v1alpha1
kind: LVMVolumeGroupSet
metadata:
name: my-lvm-volume-group-set
labels:
my-label: my-value
spec:
strategy: PerNode
nodeSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
lvmVolumeGroupTemplate:
metadata:
labels:
my-label-for-lvg: my-value-for-lvg
spec:
type: Local
blockDeviceSelector:
matchLabels:
status.blockdevice.storage.deckhouse.io/model: <model>
actualVGNameOnTheNode: <actual-vg-name-on-the-node>
```
32 changes: 32 additions & 0 deletions docs/FAQ_RU.md → docs/FAQ.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,35 @@ vgchange myvg-0 --deltag storage.deckhouse.io/enabled=true
Это возможно в случае, если вы создавали `LVM Volume Group` через ресурс `LVMVolumeGroup` (в таком случае контроллер автоматически вешает данный LVM-тег на созданную `LVM Volume Group`). Либо на данной `Volume Group` или ее `Thin-pool` был LVM-тег модуля `linstor` — `linstor-*`.

При миграции с встроенного модуля `linstor` на модули `sds-node-configurator` и `sds-drbd` автоматически происходит изменение LVM-тегов `linstor-*` на LVM-тег `storage.deckhouse.io/enabled=true` в `Volume Group`. Таким образом, управление этими `Volume Group` передается модулю `sds-node-configurator`.

## Как использовать ресурс `LVMVolumeGroupSet` для создания `LVMVolumeGroup`?

Для создания `LVMVolumeGroup` с помощью `LVMVolumeGroupSet` необходимо указать в спецификации `LVMVolumeGroupSet` селекторы для узлов и шаблон для создаваемых ресурсов `LVMVolumeGroup`. На данный момент поддерживается только стратегия `PerNode`, при которой контроллер создаст по одному ресурсу `LVMVolumeGroup` из шаблона для каждого узла, удовлетворяющего селектору.

Пример спецификации `LVMVolumeGroupSet`:

```yaml
apiVersion: storage.deckhouse.io/v1alpha1
kind: LVMVolumeGroupSet
metadata:
name: my-lvm-volume-group-set
labels:
my-label: my-value
spec:
strategy: PerNode
nodeSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
lvmVolumeGroupTemplate:
metadata:
labels:
my-label-for-lvg: my-value-for-lvg
spec:
type: Local
blockDeviceSelector:
matchLabels:
status.blockdevice.storage.deckhouse.io/model: <model>
actualVGNameOnTheNode: <actual-vg-name-on-the-node>


```
Loading
Loading