From e3af003d814037fc24ea226a80beb6cec7265b7d Mon Sep 17 00:00:00 2001 From: Viktor Kramarenko Date: Tue, 7 May 2024 15:54:34 +0300 Subject: [PATCH] [controller] Add docs for local-csi-node-watcher controller Signed-off-by: Viktor Kramarenko --- docs/FAQ.md | 94 +++++++++++++++++++++++++++++------------------ docs/FAQ.ru.md | 93 ++++++++++++++++++++++++++++------------------ docs/README.md | 2 +- docs/README.ru.md | 2 +- 4 files changed, 118 insertions(+), 73 deletions(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index df6fda0d..57e38985 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -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. @@ -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`. @@ -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). \ No newline at end of file +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 +``` \ No newline at end of file diff --git a/docs/FAQ.ru.md b/docs/FAQ.ru.md index af7b4fbe..448c657f 100644 --- a/docs/FAQ.ru.md +++ b/docs/FAQ.ru.md @@ -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`. @@ -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`. @@ -220,4 +186,59 @@ lvg-on-worker-5 Operational node-worker-5 204796Mi 0 test Во избежание непредвиденной потери контроля за уже созданными с помощью модуля томами пользователю необходимо вручную удалить зависимые ресурсы, совершив необходимые операции над томом. -Процесс проверки на наличие вышеуказанных ресурсов описан [здесь](#как-проверить-имеются-ли-зависимые-ресурсы-lvmvolumegroup-на-узле-). \ No newline at end of file +Процесс проверки на наличие вышеуказанных ресурсов описан [здесь](#как-проверить-имеются-ли-зависимые-ресурсы-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 +``` \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 7cfb1da7..8edd57af 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 diff --git a/docs/README.ru.md b/docs/README.ru.md index 36a4c28a..6f87ee00 100644 --- a/docs/README.ru.md +++ b/docs/README.ru.md @@ -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` хранилище.