Skip to content

Commit

Permalink
[controller] Add docs for local-csi-node-watcher controller
Browse files Browse the repository at this point in the history
Signed-off-by: Viktor Kramarenko <viktor.kramarenko@flant.com>
  • Loading branch information
ViktorKram committed May 7, 2024
1 parent 8dfbc51 commit e3af003
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 73 deletions.
94 changes: 59 additions & 35 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,6 @@ nodeSelector:
my-custom-label-key: my-custom-label-value
```

You can also additionally check the selectors used by the module in the configuration of the secret `d8-sds-local-volume-controller-config` in the namespace `d8-sds-local-volume`.

```shell
kubectl -n d8-sds-local-volume get secret d8-sds-local-volume-controller-config -o jsonpath='{.data.config}' | base64 --decode
```

The approximate output of the command would be:

```yaml
nodeSelector:
kubernetes.io/os: linux
my-custom-label-key: my-custom-label-value
```

> В выводе данной команды должны быть указаны все метки из настроек модуля `data.nodeSelector`, а также `kubernetes.io/os: linux`.

Nodes whose labels include the set specified in the settings are selected by the module as targets for usage. Therefore, by changing the `nodeSelector` field, you can influence the list of nodes that the module will use.

> Please note that the `nodeSelector` field can contain any number of labels, but it's crucial that each of the specified labels is present on the node you intend to use for working with the module. It's only when all the specified labels are present on the selected node that the `sds-local-volume-csi-node` pod will be launched.
Expand All @@ -92,24 +76,7 @@ Please verify that the pod `sds-local-volume-csi-node` is running on the selecte
kubectl -n d8-sds-local-volume get po -owide
```

If the pod is missing, it's necessary to check that the selected node has all the labels specified in the secret `d8-sds-local-volume-controller-config`.

```shell
kubectl -n d8-sds-local-volume get secret d8-sds-local-volume-controller-config -o jsonpath='{.data.config}' | base64 --decode
```

```shell
kubectl get node %node-name% --show-labels
```

If the pod is missing, it means that this node does not satisfy the `nodeSelector` specified in the `ModuleConfig` settings for `sds-local-volume`. The module configuration and `nodeSelector` are described [here](#i-dont-want-the-module-to-be-used-on-all-nodes-of-the-cluster-how-can-i-select-the-desired-nodes).

If the labels are present, it's necessary to check for the presence of the label `storage.deckhouse.io/sds-local-volume-node=` on the node. If the label is missing, it's advisable to verify if `sds-local-volume-controller` is running. If it is, then check the logs:

```shell
kubectl -n d8-sds-local-volume get po -l app=sds-local-volume-controller
kubectl -n d8-sds-local-volume logs -l app=sds-local-volume-controller
```
If the pod is missing, please ensure that all labels specified in the module settings in the `nodeSelector` field are present on the selected node. More details about this can be found [here](#service-pods-for-the-sds-local-volume-components-are-not-being-created-on-the-node-i-need-why-is-that).

## How do I take a node out of the module's control?
To take a node out of the module's control, you need to remove the labels specified in the `nodeSelector` field in the module settings for `sds-local-volume`.
Expand Down Expand Up @@ -221,4 +188,61 @@ Most likely, there are `LVMVolumeGroup` resources present on the node, which are

To avoid unintentionally losing control over volumes already created using the module, the user needs to manually delete dependent resources by performing necessary operations on the volume."

The process of checking for the presence of the aforementioned resources is described [here](#how-to-check-if-there-are-dependent-resources-lvmvolumegroup-on-the-node).
The process of checking for the presence of the aforementioned resources is described [here](#how-to-check-if-there-are-dependent-resources-lvmvolumegroup-on-the-node).


## Service pods for the `sds-local-volume` components are not being created on the node I need. Why is that?

With a high probability, the issues are related to the labels on the node.

Nodes to be used by the module are determined by special labels specified in the `nodeSelector` field in the module settings.

To display the existing labels specified in the `nodeSelector` field, you can execute the command:

```shell
kubectl get mc sds-local-volume -o=jsonpath={.spec.settings.dataNodes.nodeSelector}
```

The approximate output of the command would be:

```yaml
nodeSelector:
my-custom-label-key: my-custom-label-value
```

Nodes whose labels include the set specified in the settings are chosen by the module as targets for usage.

You can also additionally check the selectors used by the module in the configuration of the secret `d8-sds-local-volume-controller-config` in the namespace `d8-sds-local-volume`.

```shell
kubectl -n d8-sds-local-volume get secret d8-sds-local-volume-controller-config -o jsonpath='{.data.config}' | base64 --decode
```

The approximate output of the command would be:

```yaml
nodeSelector:
kubernetes.io/os: linux
my-custom-label-key: my-custom-label-value
```

> The output of this command should include all labels from the settings of the `data.nodeSelector` module, as well as `kubernetes.io/os: linux`.

Check the labels on the node you need:

```shell
kubectl get node %node-name% --show-labels
```

If necessary, add the missing labels to the desired node:

```shell
kubectl label node %node-name% my-custom-label-key=my-custom-label-value
```

If the labels are present, it's necessary to check for the existence of the label `storage.deckhouse.io/sds-local-volume-node=` on the node. If the label is absent, it's advisable to verify whether `sds-local-volume-controller` is functioning properly. If it is, then check the logs:

```shell
kubectl -n d8-sds-local-volume get po -l app=sds-local-volume-controller
kubectl -n d8-sds-local-volume logs -l app=sds-local-volume-controller
```
93 changes: 57 additions & 36 deletions docs/FAQ.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,6 @@ nodeSelector:
my-custom-label-key: my-custom-label-value
```

Также Вы можете дополнительно проверить селекторы, которые используются модулем в конфиге секрета `d8-sds-local-volume-controller-config` в пространстве имен `d8-sds-local-volume`.

```shell
kubectl -n d8-sds-local-volume get secret d8-sds-local-volume-controller-config -o jsonpath='{.data.config}' | base64 --decode
```

Примерный вывод команды:

```yaml
nodeSelector:
kubernetes.io/os: linux
my-custom-label-key: my-custom-label-value
```

> В выводе данной команды должны быть указаны все метки из настроек модуля `data.nodeSelector`, а также `kubernetes.io/os: linux`.

Узлы, метки которых включают в себя набор, указанный в настройках, выбираются модулем как целевые для использования. Соответственно, изменяя поле `nodeSelector` Вы можете влиять на список узлов, которые будут использованы модулем.

> Обратите внимание, что в поле `nodeSelector` может быть указано любое количество меток, но важно, чтобы каждая из указанных меток присутствовала на узле, который Вы собираетесь использовать для работы с модулем. Именно при наличии всех указанных меток на выбранном узле, произойдет запуск pod-а `sds-local-volume-csi-node`.
Expand All @@ -91,25 +75,7 @@ nodeSelector:
kubectl -n d8-sds-local-volume get po -owide
```

Если pod отсутствует, необходимо проверить, что на нужном узле имеются все указанные в секрете `d8-sds-local-volume-controller-config` метки.

```shell
kubectl -n d8-sds-local-volume get secret d8-sds-local-volume-controller-config -o jsonpath='{.data.config}' | base64 --decode
```

```shell
kubectl get node %node-name% --show-labels
```

Если pod отсутствует, значит данный узел не удовлетворяет `nodeSelector`, указанному в настройках `ModuleConfig` `sds-local-volume`.
Настройка модуля и `nodeSelector` описаны [здесь](#я-не-хочу-чтобы-модуль-использовался-на-всех-узлах-кластера-как-мне-выбрать-желаемые-узлы-).

Если метки присутствуют, необходимо проверить наличие метки `storage.deckhouse.io/sds-local-volume-node=` на узле. Если метка отсутствует, следует проверить работает ли `sds-local-volume-controller`, и в случае его работоспособности, проверить логи:

```shell
kubectl -n d8-sds-local-volume get po -l app=sds-local-volume-controller
kubectl -n d8-sds-local-volume logs -l app=sds-local-volume-controller
```
Если pod отсутствует, пожалуйста, убедитесь, что на выбранном узле присутствуют все метки, указанные в настройках модуля в поле `nodeSelector`. Подробнее об этом [здесь](#служебные-поды-компонентов-sds-local-volume-не-создаются-на-нужном-мне-узле-почему).

## Я хочу вывести узел из-под управления модуля, что делать?
Для вывода узла из-под управления модуля необходимо убрать метки, указанные в поле `nodeSelector` в настройках модуля `sds-local-volume`.
Expand Down Expand Up @@ -220,4 +186,59 @@ lvg-on-worker-5 Operational node-worker-5 204796Mi 0 test

Во избежание непредвиденной потери контроля за уже созданными с помощью модуля томами пользователю необходимо вручную удалить зависимые ресурсы, совершив необходимые операции над томом.

Процесс проверки на наличие вышеуказанных ресурсов описан [здесь](#как-проверить-имеются-ли-зависимые-ресурсы-lvmvolumegroup-на-узле-).
Процесс проверки на наличие вышеуказанных ресурсов описан [здесь](#как-проверить-имеются-ли-зависимые-ресурсы-lvmvolumegroup-на-узле-).

## Служебные pod-ы компонентов `sds-local-volume` не создаются на нужном мне узле. Почему?
С высокой вероятностью проблемы связаны с метками на узле.

Узлы, которые будут задействованы модулем, определяются специальными метками, указанными в поле `nodeSelector` в настройках модуля.

Для отображения существующих меток, указанных в поле `nodeSelector`, можно выполнить команду:

```shell
kubectl get mc sds-local-volume -o=jsonpath={.spec.settings.dataNodes.nodeSelector}
```

Примерный вывод команды:

```yaml
nodeSelector:
my-custom-label-key: my-custom-label-value
```

Узлы, метки которых включают в себя набор, указанный в настройках, выбираются модулем как целевые для использования.

Также Вы можете дополнительно проверить селекторы, которые используются модулем в конфиге секрета `d8-sds-local-volume-controller-config` в пространстве имен `d8-sds-local-volume`.

```shell
kubectl -n d8-sds-local-volume get secret d8-sds-local-volume-controller-config -o jsonpath='{.data.config}' | base64 --decode
```

Примерный вывод команды:

```yaml
nodeSelector:
kubernetes.io/os: linux
my-custom-label-key: my-custom-label-value
```

> В выводе данной команды должны быть указаны все метки из настроек модуля `data.nodeSelector`, а также `kubernetes.io/os: linux`.

Проверьте метки на нужном вам узле:

```shell
kubectl get node %node-name% --show-labels
```

При необходимости добавьте недостающие метки на желаемый узел:

```shell
kubectl label node %node-name% my-custom-label-key=my-custom-label-value
```

Если метки присутствуют, необходимо проверить наличие метки `storage.deckhouse.io/sds-local-volume-node=` на узле. Если метка отсутствует, следует проверить работает ли `sds-local-volume-controller`, и в случае его работоспособности, проверить логи:

```shell
kubectl -n d8-sds-local-volume get po -l app=sds-local-volume-controller
kubectl -n d8-sds-local-volume logs -l app=sds-local-volume-controller
```
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ By default, the pods will be scheduled on all nodes in the cluster. You can veri
kubectl -n d8-sds-local-volume get pod -owide
```

> The location of the pod data is determined by special labels (nodeSelector) specified in the `spec.settings.dataNodes.nodeSelector` field in the module settings. For more detailed information on the configuration, please follow the [link](FAQ.md#i-dont-want-the-module-to-be-used-on-all-nodes-of-the-cluster-how-can-i-select-the-desired-nodes)
> The location of the pod data is determined by special labels (nodeSelector) specified in the `spec.settings.dataNodes.nodeSelector` field in the module settings. For more detailed information on the configuration, please follow the [link](./faq.html#i-dont-want-the-module-to-be-used-on-all-nodes-of-the-cluster-how-can-i-select-the-desired-nodes).
### Configuring storage on nodes

Expand Down
2 changes: 1 addition & 1 deletion docs/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ kubectl -n d8-sds-node-configurator get pod -o wide -w
kubectl -n d8-sds-local-volume get pod -owide
```

> Расположение данных pod-ов определяется специальными метками (nodeSelector), которые указываются в поле `spec.settings.dataNodes.nodeSelector` в настройках модуля. Для получения более подробной информации о настройке, пожалуйста, перейдите по [ссылке](FAQ.ru.md#я-не-хочу-чтобы-модуль-использовался-на-всех-узлах-кластера-как-мне-выбрать-желаемые-узлы-)
> Расположение данных pod-ов определяется специальными метками (nodeSelector), которые указываются в поле `spec.settings.dataNodes.nodeSelector` в настройках модуля. Для получения более подробной информации о настройке, пожалуйста, перейдите по [ссылке](./faq.html#я-не-хочу-чтобы-модуль-использовался-на-всех-узлах-кластера-как-мне-выбрать-желаемые-узлы)
### Настройка хранилища на узлах
Необходимо на этих узлах создать группы томов `LVM` с помощью пользовательских ресурсов `LVMVolumeGroup`. В быстром старте будем создавать обычное `Thick` хранилище.
Expand Down

0 comments on commit e3af003

Please sign in to comment.