How do I add a master nodes to a cloud cluster (single-master to a multi-master)? | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Как добавить master-узлы в облачном кластере? | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Как конвертировать кластер с одним master-узлом в мультикластерный описано в FAQ модуля control-plane-manager. | How do I reduce the number of master nodes in a cloud cluster (multi-master to single-master)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как уменьшить число master-узлов в облачном кластере? | Static nodes | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как конвертировать мультимастерный кластер в кластер с одним master-узлом описано в FAQ модуля control-plane-manager. |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Статические узлы | You can add a static node to the cluster manually (an example) or by using Cluster API Provider Static. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| How do I add a static node to a cluster (Cluster API Provider Static)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Добавить статический узел в кластер можно вручную (пример) или с помощью Cluster API Provider Static. | To add a static node to a cluster (bare metal server or virtual machine), follow these steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как добавить статический узел в кластер (Cluster API Provider Static)? |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Чтобы добавить статический узел в кластер (сервер bare-metal или виртуальную машину), выполните следующие шаги: |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell useradd -m -s /bin/bash caps usermod -aG sudo caps | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell useradd -m -s /bin/bash caps usermod -aG sudo caps | shell caps ALL=(ALL) NOPASSWD: ALL | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell caps ALL=(ALL) NOPASSWD: ALL | shell sudo systemctl restart sshd | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell sudo systemctl restart sshd | shell ssh-keygen -t rsa -f caps-id -C “” -N “” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| The public and private keys of the caps user will be stored in the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell ssh-keygen -t rsa -f caps-id -C “” -N “” |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Приватный и публичный ключи будут сохранены в файлах | shell mkdir -p /home/caps/.ssh cat caps-id.pub » /home/caps/.ssh/authorized_keys chmod 700 /home/caps/.ssh chmod 600 /home/caps/.ssh/authorized_keys chown -R caps:caps /home/caps/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell mkdir -p /home/caps/.ssh cat caps-id.pub » /home/caps/.ssh/authorized_keys chmod 700 /home/caps/.ssh chmod 600 /home/caps/.ssh/authorized_keys chown -R caps:caps /home/caps/ | An example of adding a static node. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| How do I add a batch of static nodes to a cluster manually? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример добавления статического узла. | Use an existing one or create a new NodeGroup custom resource (example of the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как добавить несколько статических узлов в кластер вручную? | You can automate the bootstrap process with any automation platform you prefer. The following is an example for Ansible. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Используйте существующий или создайте новый кастомный ресурс (Custom Resource) NodeGroup (пример |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Автоматизировать процесс добавления узлов можно с помощью любой платформы автоматизации. Далее приведен пример для Ansible. | shell kubectl -n default get ep kubernetes -o json | jq ‘.subsets[0].addresses[0].ip + “:” + (.subsets[0].ports[0].port | tostring)’ -r | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Check the K8s version. If the version >= 1.25, create | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl -n default get ep kubernetes -o json | jq ‘.subsets[0].addresses[0].ip + “:” + (.subsets[0].ports[0].port | tostring)’ -r | shell kubectl create token node-group –namespace d8-cloud-instance-manager –duration 1h | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Проверьте версию K8s. Если версия >= 1.25, создайте токен | Save the token you got and add it to the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl create token node-group –namespace d8-cloud-instance-manager –duration 1h |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Сохраните полученный токен, и добавьте в поле | shell
kubectl -n d8-cloud-instance-manager get $(kubectl -n d8-cloud-instance-manager get secret -o name | grep node-group-token) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell
kubectl -n d8-cloud-instance-manager get $(kubectl -n d8-cloud-instance-manager get secret -o name | grep node-group-token) | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| yaml
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
text [system] system-0 system-1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| [system:vars] node_group=system | ||||||||||||||||||||||||||||||||||||||||||||||||||||
text [system] system-0 system-1 | [worker] worker-0 worker-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
[system:vars] node_group=system | [worker:vars] node_group=worker | ||||||||||||||||||||||||||||||||||||||||||||||||||||
[worker] worker-0 worker-1 |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
[worker:vars] node_group=worker | How do I clean up a static node manually? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| This method is valid for both manually configured nodes (using the bootstrap script) and nodes configured using CAPS. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как вручную очистить статический узел? | To decommission a node from the cluster and clean up the server (VM), run the following command on the node: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell bash /var/lib/bashible/cleanup_static_node.sh –yes-i-am-sane-and-i-understand-what-i-am-doing | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Инструкция справедлива как для узла, настроенного вручную (с помощью бутстрап-скрипта), так и для узла, настроенного с помощью CAPS. | Can I delete a StaticInstance? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Чтобы вывести из кластера узел и очистить сервер (ВМ), выполните следующую команду на узле: | A StaticInstance that is in the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell bash /var/lib/bashible/cleanup_static_node.sh –yes-i-am-sane-and-i-understand-what-i-am-doing | To delete a StaticInstance in any state other than | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Можно ли удалить StaticInstance? |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
StaticInstance, находящийся в состоянии | Example command for adding a label: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Чтобы удалить StaticInstance находящийся в любом состоянии, отличном от | shell d8 k label staticinstance d8cluster-worker node.deckhouse.io/allow-bootstrap=false | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример команды для добавления лейбла: | To check the status of StaticInstance, use the command: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell d8 k label staticinstance d8cluster-worker node.deckhouse.io/allow-bootstrap=false | shell d8 k get staticinstances | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для проверки статуса StaticInstance используйте команду: | Example command for deleting StaticInstance: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell d8 k get staticinstances | shell d8 k delete staticinstance d8cluster-worker | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример команды для удаления StaticInstance: | How do I change the IP address of a StaticInstance? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell d8 k delete staticinstance d8cluster-worker | You cannot change the IP address in the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| How do I migrate a manually configured static node under CAPS control? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как изменить IP-адрес StaticInstance? | You need to clean up the node, then hand over the node under CAPS control. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Изменить IP-адрес в ресурсе | How do I change the NodeGroup of a static node? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как мигрировать статический узел настроенный вручную под управление CAPS? | Note that if a node is under CAPS control, you cannot change the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Необходимо выполнить очистку узла, затем добавить узел под управление CAPS. | To switch an existing manually created static node to another | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как изменить NodeGroup у статического узла? | shell
kubectl label node –overwrite | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Applying the changes will take some time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Если узел находится под управлением CAPS, то изменить принадлежность к | How to clean up a node for adding to the cluster? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Чтобы перенести существующий статический узел созданный вручную из одной | This is only needed if you have to move a static node from one cluster to another. Be aware these operations remove local storage data. If you just need to change a NodeGroup, follow this instruction. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell
kubectl label node –overwrite | Evict resources from the node and remove the node from LINSTOR/DRBD using the instruction if the node you are cleaning up has LINSTOR/DRBD storage pools. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Применение изменений потребует некоторого времени. |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как очистить узел для последующего ввода в кластер? | shell
kubectl drain | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Это необходимо только в том случае, если нужно переместить статический узел из одного кластера в другой. Имейте в виду, что эти операции удаляют данные локального хранилища. Если необходимо просто изменить |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Если на зачищаемом узле есть пулы хранения LINSTOR/DRBD, то предварительно перенесите ресурсы с узла и удалите узел LINSTOR/DRBD, следуя инструкции. | shell bash /var/lib/bashible/cleanup_static_node.sh –yes-i-am-sane-and-i-understand-what-i-am-doing | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell
kubectl drain | How do I know if something went wrong? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| If a node in a nodeGroup is not updated (the value of | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell bash /var/lib/bashible/cleanup_static_node.sh –yes-i-am-sane-and-i-understand-what-i-am-doing | To view the logs of the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell journalctl -fu bashible | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как понять, что что-то пошло не так? | Example of output when the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Если узел в NodeGroup не обновляется (значение | console May 25 04:39:16 kube-master-0 systemd[1]: Started Bashible service. May 25 04:39:16 kube-master-0 bashible.sh[1976339]: Configuration is in sync, nothing to do. May 25 04:39:16 kube-master-0 systemd[1]: bashible.service: Succeeded. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Чтобы проверить логи сервиса | How do I know what is running on a node while it is being created? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell journalctl -fu bashible | You can analyze | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример вывода, когда все необходимые действия выполнены: |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
console May 25 04:39:16 kube-master-0 systemd[1]: Started Bashible service. May 25 04:39:16 kube-master-0 bashible.sh[1976339]: Configuration is in sync, nothing to do. May 25 04:39:16 kube-master-0 systemd[1]: bashible.service: Succeeded. | shell kubectl get instances | grep Pending | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как посмотреть, что в данный момент выполняется на узле при его создании? | An example: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Если необходимо узнать, что происходит на узле (например, узел долго создается), можно проверить логи | shell $ kubectl get instances | grep Pending dev-worker-2a6158ff-6764d-nrtbj Pending 46s | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl get instances | grep Pending | shell kubectl get instances dev-worker-2a6158ff-6764d-nrtbj -o yaml | grep ‘bootstrapStatus’ -B0 -A2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример: | An example: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell $ kubectl get instances | grep Pending dev-worker-2a6158ff-6764d-nrtbj Pending 46s | shell $ kubectl get instances dev-worker-2a6158ff-6764d-nrtbj -o yaml | grep ‘bootstrapStatus’ -B0 -A2 bootstrapStatus: description: Use ‘nc 192.168.199.178 8000’ to get bootstrap logs. logsEndpoint: 192.168.199.178:8000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl get instances dev-worker-2a6158ff-6764d-nrtbj -o yaml | grep ‘bootstrapStatus’ -B0 -A2 | The logs of the initial node configuration are located at | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример: | How do I update kernel on nodes? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell $ kubectl get instances dev-worker-2a6158ff-6764d-nrtbj -o yaml | grep ‘bootstrapStatus’ -B0 -A2 bootstrapStatus: description: Use ‘nc 192.168.199.178 8000’ to get bootstrap logs. logsEndpoint: 192.168.199.178:8000 | Debian-based distros | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Create a | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Логи первоначальной настройки узла находятся в | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: install-kernel.sh spec: bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как обновить ядро на узлах? | desired_version=”5.15.0-53-generic” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для дистрибутивов, основанных на Debian | bb-event-on ‘bb-package-installed’ ‘post-install’ post-install() { bb-log-info “Setting reboot flag due to kernel was updated” bb-flag-set reboot } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Создайте ресурс | version_in_use=”$(uname -r)” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: install-kernel.sh spec: bundles:
| if [[ “$version_in_use” == “$desired_version” ]]; then exit 0 fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
desired_version=”5.15.0-53-generic” | bb-deckhouse-get-disruptive-update-approval bb-apt-install “linux-image-${desired_version}” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bb-event-on ‘bb-package-installed’ ‘post-install’ post-install() { bb-log-info “Setting reboot flag due to kernel was updated” bb-flag-set reboot } | CentOS-based distros | ||||||||||||||||||||||||||||||||||||||||||||||||||||
version_in_use=”$(uname -r)” | Create a | ||||||||||||||||||||||||||||||||||||||||||||||||||||
if [[ “$version_in_use” == “$desired_version” ]]; then exit 0 fi | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: install-kernel.sh spec: bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
bb-deckhouse-get-disruptive-update-approval bb-apt-install “linux-image-${desired_version}” | desired_version=”3.10.0-1160.42.2.el7.x86_64” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для дистрибутивов, основанных на CentOS | bb-event-on ‘bb-package-installed’ ‘post-install’ post-install() { bb-log-info “Setting reboot flag due to kernel was updated” bb-flag-set reboot } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Создайте ресурс | version_in_use=”$(uname -r)” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: install-kernel.sh spec: bundles:
| if [[ “$version_in_use” == “$desired_version” ]]; then exit 0 fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
desired_version=”3.10.0-1160.42.2.el7.x86_64” | bb-deckhouse-get-disruptive-update-approval bb-dnf-install “kernel-${desired_version}” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bb-event-on ‘bb-package-installed’ ‘post-install’ post-install() { bb-log-info “Setting reboot flag due to kernel was updated” bb-flag-set reboot } | NodeGroup parameters and their result | ||||||||||||||||||||||||||||||||||||||||||||||||||||
version_in_use=”$(uname -r)” |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
if [[ “$version_in_use” == “$desired_version” ]]; then exit 0 fi | Refer to the description of the NodeGroup custom resource for more information about the parameters. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bb-deckhouse-get-disruptive-update-approval bb-dnf-install “kernel-${desired_version}” | Changing the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Какие параметры NodeGroup к чему приводят? | During the disruption update, an evict of the pods from the node is performed. If any pod failes to evict, the evict is repeated every 20 seconds until a global timeout of 5 minutes is reached. After that, the pods that failed to evict are removed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| How do I redeploy ephemeral machines in the cloud with a new configuration? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Подробно о всех параметрах можно прочитать в описании кастомного ресурса NodeGroup. | If the Deckhouse configuration is changed (both in the node-manager module and in any of the cloud providers), the VMs will not be redeployed. The redeployment is performed only in response to changing | ||||||||||||||||||||||||||||||||||||||||||||||||||||
В случае изменения параметров | To force the redeployment of all Machines, you need to add/modify the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
При обновлении, которое требует прерывания работы узла (disruption update), выполняется процесс вытеснения подов с узла. Если какой-либо под не может быть вытеснен, попытка повторяется каждые 20 секунд до достижения глобального таймаута в 5 минут. После истечения этого времени, поды, которые не удалось вытеснить, удаляются принудительно. | How do I allocate nodes to specific loads? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как пересоздать эфемерные машины в облаке с новой конфигурацией? | You cannot use the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
При изменении конфигурации Deckhouse (как в модуле | There are two ways to solve this problem: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Чтобы принудительно пересоздать все узлы, связанные с ресурсом |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как выделить узлы под специфические нагрузки? | Deckhouse tolerates the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Запрещено использование домена | To use custom keys for | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для решений данной задачи существуют два механизма: | How to allocate nodes to system components? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Frontend | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Deckhouse по умолчанию поддерживает использование taint’а с ключом | For Ingress controllers, use the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Если требуется использовать другие ключи для taints (например, | yaml nodeTemplate: labels: node-role.deckhouse.io/frontend: “” taints:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Подробности в статье на Habr. | System components | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как выделить узлы под системные компоненты? |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Фронтенд | yaml nodeTemplate: labels: node-role.deckhouse.io/system: “” taints:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для Ingress-контроллеров используйте | How do I speed up node provisioning on the cloud when scaling applications horizontally? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml nodeTemplate: labels: node-role.deckhouse.io/frontend: “” taints:
| The most efficient way is to have some extra nodes “ready”. In this case, you can run new application replicas on them almost instantaneously. The obvious disadvantage of this approach is the additional maintenance costs related to these nodes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Системные | Here is how you should configure the target | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для компонентов подсистем Deckhouse параметр |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml nodeTemplate: labels: node-role.deckhouse.io/system: “” taints:
| An example: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как ускорить заказ узлов в облаке при горизонтальном масштабировании приложений? | yaml cloudInstances: maxPerZone: 10 minPerZone: 1 standby: 10% standbyHolder: overprovisioningRate: 30% | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Самое действенное — держать в кластере некоторое количество предварительно подготовленных узлов, которые позволят новым репликам ваших приложений запускаться мгновенно. Очевидным минусом данного решения будут дополнительные расходы на содержание этих узлов. | How do I disable machine-controller-manager/CAPI in the case of potentially cluster-damaging changes? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Необходимые настройки целевой | Use this switch only if you know what you are doing and clearly understand the consequences. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Set the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример: | yaml mcmEmergencyBrake: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml cloudInstances: maxPerZone: 10 minPerZone: 1 standby: 10% standbyHolder: overprovisioningRate: 30% | For disabling CAPI, set the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как выключить machine-controller-manager/CAPI в случае выполнения потенциально деструктивных изменений в кластере? | yaml capiEmergencyBrake: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Использовать эту настройку допустимо только тогда, когда вы четко понимаете, зачем это необходимо. | How do I restore the master node if kubelet cannot load the control plane components? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для того чтобы временно отключить machine-controller-manager (MCM) и предотвратить его автоматические действия, которые могут повлиять на инфраструктуру кластера (например, удаление или пересоздание узлов), установите следующий параметр в конфигурации: | Such a situation may occur if images of the control plane components on the master were deleted in a cluster that has a single master node (e.g., the directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml mcmEmergencyBrake: true | Below is an instruction on how you can restore the master node. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для отключения CAPI установите следующий параметр в конфигурации: | containerd | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml capiEmergencyBrake: true | Execute the following command to restore the master node in any cluster running under Deckhouse: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как восстановить master-узел, если kubelet не может загрузить компоненты control plane? | shell kubectl -n d8-system get secrets deckhouse-registry -o json | jq -r ‘.data.”.dockerconfigjson”’ | base64 -d | jq -r ‘.auths.”registry.deckhouse.io”.auth’ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Подобная ситуация может возникнуть, если в кластере с одним master-узлом на нем были удалены образы компонентов control plane (например, удалена директория | Copy the command’s output and use it for setting the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Далее приведена инструкция по восстановлению master-узла. | Next, you need to pull images of | ||||||||||||||||||||||||||||||||||||||||||||||||||||
containerd | shell for image in $(grep “image:” /etc/kubernetes/manifests/* | awk ‘{print $3}’); do crictl pull –auth $AUTH $image done | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для восстановления работоспособности master-узла нужно в любом рабочем кластере под управлением Deckhouse выполнить команду: | You need to restart | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl -n d8-system get secrets deckhouse-registry -o json | jq -r ‘.data.”.dockerconfigjson”’ | base64 -d | jq -r ‘.auths.”registry.deckhouse.io”.auth’ | How to change CRI for NodeGroup? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Вывод команды нужно скопировать и присвоить переменной | CRI can only be switched from | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Далее на поврежденном master-узле нужно загрузить образы компонентов | Set NodeGroup | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell for image in $(grep “image:” /etc/kubernetes/manifests/* | awk ‘{print $3}’); do crictl pull –auth $AUTH $image done | NodeGroup YAML example: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
После загрузки образов необходимо перезапустить | yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: worker spec: nodeType: Static cri: type: Containerd | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как изменить CRI для NodeGroup? | Also, this operation can be done with patch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Смена CRI возможна только между |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для изменения CRI для NodeGroup, установите параметр cri.type в | shell
kubectl patch nodegroup | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример YAML-манифеста NodeGroup: |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: worker spec: nodeType: Static cri: type: Containerd | shell
kubectl patch nodegroup | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Также эту операцию можно выполнить с помощью патча: | While changing | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| After setting up a new CRI for NodeGroup, the node-manager module drains nodes one by one and installs a new CRI on them. Node update
is accompanied by downtime (disruption). Depending on the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl patch nodegroup <имя NodeGroup=""> --type merge -p '{"spec":{"cri":{"type":"Containerd"}}}'имя> | How to change CRI for the whole cluster? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| CRI can only be switched from | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl patch nodegroup <имя NodeGroup=""> --type merge -p '{"spec":{"cri":{"type":"NotManaged"}}}'имя> | It is necessary to use the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
При изменении | Also, this operation can be done with the following patch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
После изменения CRI для NodeGroup модуль |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как изменить CRI для всего кластера? | shell data=”$(kubectl -n kube-system get secret d8-cluster-configuration -o json | jq -r ‘.data.”cluster-configuration.yaml”’ | base64 -d | sed “s/NotManaged/Containerd/” | base64 -w0)” kubectl -n kube-system patch secret d8-cluster-configuration -p “{"data":{"cluster-configuration.yaml":"$data"}}” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Смена CRI возможна только между |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для изменения CRI для всего кластера, необходимо с помощью утилиты | shell data=”$(kubectl -n kube-system get secret d8-cluster-configuration -o json | jq -r ‘.data.”cluster-configuration.yaml”’ | base64 -d | sed “s/Containerd/NotManaged/” | base64 -w0)” kubectl -n kube-system patch secret d8-cluster-configuration -p “{"data":{"cluster-configuration.yaml":"$data"}}” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Также возможно выполнить эту операцию с помощью | If it is necessary to leave some NodeGroup on another CRI, then before changing the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Changing | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell data=”$(kubectl -n kube-system get secret d8-cluster-configuration -o json | jq -r ‘.data.”cluster-configuration.yaml”’ | base64 -d | sed “s/NotManaged/Containerd/” | base64 -w0)” kubectl -n kube-system patch secret d8-cluster-configuration -p “{"data":{"cluster-configuration.yaml":"$data"}}” | When changing the CRI in the cluster, additional steps are required for the master nodes: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell data=”$(kubectl -n kube-system get secret d8-cluster-configuration -o json | jq -r ‘.data.”cluster-configuration.yaml”’ | base64 -d | sed “s/Containerd/NotManaged/” | base64 -w0)” kubectl -n kube-system patch secret d8-cluster-configuration -p “{"data":{"cluster-configuration.yaml":"$data"}}” | shell kubectl get nodes -l node-role.kubernetes.io/control-plane=”” -o json | jq ‘.items[] | select(.metadata.annotations.”update.node.deckhouse.io/approved”==””) | .metadata.name’ -r | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Если необходимо, чтобы отдельные NodeGroup использовали другой CRI, перед изменением |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Изменение | shell
kubectl annotate node | ||||||||||||||||||||||||||||||||||||||||||||||||||||
При изменении CRI в кластере для master-узлов необходимо выполнить дополнительные шаги: |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| How to add node configuration step? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl get nodes -l node-role.kubernetes.io/control-plane=”” -o json | jq ‘.items[] | select(.metadata.annotations.”update.node.deckhouse.io/approved”==””) | .metadata.name’ -r | Additional node configuration steps are set via the NodeGroupConfiguration custom resource. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| How to automatically put custom labels on the node? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl annotate node <имя master-узла=""> update.node.deckhouse.io/disruption-approved=имя> |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как добавить шаг для конфигурации узлов? |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Дополнительные шаги для конфигурации узлов задаются с помощью кастомного ресурса NodeGroupConfiguration. | console example-label=test | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как автоматически проставить на узел кастомные лейблы? |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| When adding a node to the cluster, the labels specified in the files will be automatically affixed to the node. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Please note that it is not possible to add labels used in DKP in this way. This method will only work with custom labels that do not overlap with those reserved for Deckhouse. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| How to deploy custom containerd configuration? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
console example-label=test | The example of | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Adding custom settings causes a restart of the containerd service. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
При добавлении узла в кластер указанные в файлах лейблы будут автоматически проставлены на узел. | Bashible on nodes merges main Deckhouse containerd config with configs from | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Обратите внимание, что добавить таким образом лейблы, использующиеся в DKP, невозможно. Работать такой метод будет только с кастомными лейблами, не пересекающимися с зарезервированными для Deckhouse. | You can override the values of the parameters that are specified in the file | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как развернуть кастомный конфигурационный файл containerd? | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-option-config.sh spec: bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример | mkdir -p /etc/containerd/conf.d bb-sync-file /etc/containerd/conf.d/additional_option.toml - « EOF oom_score = 500 [metrics] address = “127.0.0.1” grpc_histogram = true EOF nodeGroups:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Добавление кастомных настроек вызывает перезапуск сервиса containerd. | How to add configuration for an additional registry? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Bashible на узлах объединяет конфигурацию containerd для Deckhouse с конфигурацией из файла | Containerd supports two methods for registry configuration: the old method and the new method. To check for the presence of the old configuration method, run the following commands on the cluster nodes: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Вы можете переопределять значения параметров, которые заданы в файле | bash cat /etc/containerd/config.toml | grep ‘plugins.”io.containerd.grpc.v1.cri”.registry.mirrors’ cat /etc/containerd/config.toml | grep ‘plugins.”io.containerd.grpc.v1.cri”.registry.configs’ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-option-config.sh spec: bundles:
| Example output: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
mkdir -p /etc/containerd/conf.d bb-sync-file /etc/containerd/conf.d/additional_option.toml - « EOF oom_score = 500 [metrics] address = “127.0.0.1” grpc_histogram = true EOF nodeGroups:
| [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как добавить конфигурацию для дополнительного registry? | [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors.” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
В containerd существует два способа описания конфигурации registry: старый и новый. | [plugins.”io.containerd.grpc.v1.cri”.registry.configs] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для проверки наличия старого способа конфигурации выполните на узлах кластера следующие команды: | [plugins.”io.containerd.grpc.v1.cri”.registry.configs.” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash cat /etc/containerd/config.toml | grep ‘plugins.”io.containerd.grpc.v1.cri”.registry.mirrors’ cat /etc/containerd/config.toml | grep ‘plugins.”io.containerd.grpc.v1.cri”.registry.configs’ | To check for the presence of the new configuration method, run the following command on the cluster nodes: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример вывода: | bash cat /etc/containerd/config.toml | grep ‘/etc/containerd/registry.d’ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
[plugins.”io.containerd.grpc.v1.cri”.registry.mirrors] | Example output: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
[plugins.”io.containerd.grpc.v1.cri”.registry.mirrors.” | config_path = “/etc/containerd/registry.d” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
[plugins.”io.containerd.grpc.v1.cri”.registry.configs] | Old Method | ||||||||||||||||||||||||||||||||||||||||||||||||||||
[plugins.”io.containerd.grpc.v1.cri”.registry.configs.” | This containerd configuration format is deprecated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для проверки наличия нового способа конфигурации выполните на узлах кластера следующую команду: | The configuration is described in the main containerd configuration file | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash cat /etc/containerd/config.toml | grep ‘/etc/containerd/registry.d’ | toml [plugins] [plugins.”io.containerd.grpc.v1.cri”] [plugins.”io.containerd.grpc.v1.cri”.registry] [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors] [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors.”${REGISTRY_URL}”] endpoint = [“https://${REGISTRY_URL}”] [plugins.”io.containerd.grpc.v1.cri”.registry.configs] [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.auth] auth = “${BASE_64_AUTH}” username = “${USERNAME}” password = “${PASSWORD}” [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.tls] ca_file = “${CERT_DIR}/${CERT_NAME}.crt” insecure_skip_verify = true | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример вывода: | Adding custom settings through the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
config_path = “/etc/containerd/registry.d” | How to add additional registry auth (old method)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Старый способ | Example of adding authorization to a additional registry when using the old configuration method: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Этот формат конфигурации containerd устарел (deprecated). | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-auth.sh spec: To add a file before the ‘032_configure_containerd.sh’ step weight: 31 bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Конфигурация описывается в основном конфигурационном файле containerd | mkdir -p /etc/containerd/conf.d bb-sync-file /etc/containerd/conf.d/additional_registry.toml - « EOF [plugins] [plugins.”io.containerd.grpc.v1.cri”] [plugins.”io.containerd.grpc.v1.cri”.registry] [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors] [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors.”${REGISTRY_URL}”] endpoint = [“https://${REGISTRY_URL}”] [plugins.”io.containerd.grpc.v1.cri”.registry.configs] [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.auth] username = “username” password = “password” OR auth = “dXNlcm5hbWU6cGFzc3dvcmQ=” EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пользовательская конфигурация добавляется через механизм | How to configure a certificate for an additional registry (old method)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример конфигурационного файла для директории | Example of configuring a certificate for an additional registry when using the old configuration method: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
toml [plugins] [plugins.”io.containerd.grpc.v1.cri”] [plugins.”io.containerd.grpc.v1.cri”.registry] [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors] [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors.”${REGISTRY_URL}”] endpoint = [“https://${REGISTRY_URL}”] [plugins.”io.containerd.grpc.v1.cri”.registry.configs] [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.auth] auth = “${BASE_64_AUTH}” username = “${USERNAME}” password = “${PASSWORD}” [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.tls] ca_file = “${CERT_DIR}/${CERT_NAME}.crt” insecure_skip_verify = true | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-tls.sh spec: To add a file before the ‘032_configure_containerd.sh’ step weight: 31 bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Добавление кастомных настроек через механизм | mkdir -p ${CERTS_FOLDER} bb-sync-file “${CERTS_FOLDER}/${CERT_FILE_NAME}.crt” - « EOF —–BEGIN CERTIFICATE—– … —–END CERTIFICATE—– EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как добавить авторизацию в дополнительный registry (старый способ)? | mkdir -p /etc/containerd/conf.d bb-sync-file /etc/containerd/conf.d/additional_registry.toml - « EOF [plugins] [plugins.”io.containerd.grpc.v1.cri”] [plugins.”io.containerd.grpc.v1.cri”.registry] [plugins.”io.containerd.grpc.v1.cri”.registry.configs] [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.tls] ca_file = “${CERTS_FOLDER}/${CERT_FILE_NAME}.crt” EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример добавления авторизации в дополнительный registry при использовании старого способа конфигурации: | In addition to containerd, the certificate can be added into the OS. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-auth.sh spec: Для добавления файла перед шагом ‘032_configure_containerd.sh’ weight: 31 bundles:
| How to add TLS skip verify (old method)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
mkdir -p /etc/containerd/conf.d bb-sync-file /etc/containerd/conf.d/additional_registry.toml - « EOF [plugins] [plugins.”io.containerd.grpc.v1.cri”] [plugins.”io.containerd.grpc.v1.cri”.registry] [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors] [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors.”${REGISTRY_URL}”] endpoint = [“https://${REGISTRY_URL}”] [plugins.”io.containerd.grpc.v1.cri”.registry.configs] [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.auth] username = “username” password = “password” OR auth = “dXNlcm5hbWU6cGFzc3dvcmQ=” EOF | Example of adding TLS skip verify when using the old configuration method: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как настроить сертификат для дополнительного registry (старый способ)? | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-skip-tls.sh spec: To add a file before the ‘032_configure_containerd.sh’ step weight: 31 bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример настройки сертификата для дополнительного registry при использовании старого способа конфигурации: | mkdir -p /etc/containerd/conf.d bb-sync-file /etc/containerd/conf.d/additional_registry.toml - « EOF [plugins] [plugins.”io.containerd.grpc.v1.cri”] [plugins.”io.containerd.grpc.v1.cri”.registry] [plugins.”io.containerd.grpc.v1.cri”.registry.configs] [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.tls] insecure_skip_verify = true EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-tls.sh spec: Для добавления файла перед шагом ‘032_configure_containerd.sh’ weight: 31 bundles:
| After applying the configuration file, verify access to the registry from the nodes using the command: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
mkdir -p ${CERTS_FOLDER} bb-sync-file “${CERTS_FOLDER}/${CERT_FILE_NAME}.crt” - « EOF —–BEGIN CERTIFICATE—– … —–END CERTIFICATE—– EOF | bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||
mkdir -p /etc/containerd/conf.d bb-sync-file /etc/containerd/conf.d/additional_registry.toml - « EOF [plugins] [plugins.”io.containerd.grpc.v1.cri”] [plugins.”io.containerd.grpc.v1.cri”.registry] [plugins.”io.containerd.grpc.v1.cri”.registry.configs] [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.tls] ca_file = “${CERTS_FOLDER}/${CERT_FILE_NAME}.crt” EOF | Via the CRI interface crictl pull private.registry.example/image/repo:tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Помимо сontainerd, сертификат можно добавить в операционную систему. | New Method | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как добавить TLS skip verify (старый способ)? | Used in containerd v2. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример добавления TLS skip verify при использовании старого способа конфигурации: | The configuration is defined in the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-skip-tls.sh spec: Для добавления файла перед шагом ‘032_configure_containerd.sh’ weight: 31 bundles:
| bash /etc/containerd/registry.d ├── private.registry.example:5001 │ ├── ca.crt │ └── hosts.toml └── registry.deckhouse.ru ├── ca.crt └── hosts.toml | ||||||||||||||||||||||||||||||||||||||||||||||||||||
mkdir -p /etc/containerd/conf.d bb-sync-file /etc/containerd/conf.d/additional_registry.toml - « EOF [plugins] [plugins.”io.containerd.grpc.v1.cri”] [plugins.”io.containerd.grpc.v1.cri”.registry] [plugins.”io.containerd.grpc.v1.cri”.registry.configs] [plugins.”io.containerd.grpc.v1.cri”.registry.configs.”${REGISTRY_URL}”.tls] insecure_skip_verify = true EOF | Example contents of the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
После применения конфигурационного файла проверьте доступ к registry с узлов, используя команду: | toml [host] Mirror 1 [host.”https://${REGISTRY_URL_1}”] capabilities = [“pull”, “resolve”] ca = [”${CERT_DIR}/${CERT_NAME}.crt”] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash | [host.”https://${REGISTRY_URL_1}”.auth] username = “${USERNAME}” password = “${PASSWORD}” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Через cri-интерфейс crictl pull private.registry.example/image/repo:tag | Mirror 2 [host.”http://${REGISTRY_URL_2}”] capabilities = [“pull”, “resolve”] skip_verify = true | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Новый способ | Configuration changes do not cause the containerd service to restart. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Используется в containerd v2. | How to add additional registry auth (new method)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Конфигурация описывается в каталоге | Example of adding authorization to a additional registry when using the new configuration method: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash /etc/containerd/registry.d ├── private.registry.example:5001 │ ├── ca.crt │ └── hosts.toml └── registry.deckhouse.ru ├── ca.crt └── hosts.toml | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-auth.sh spec: The step can be arbitrary, as restarting the containerd service is not required weight: 0 bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример содержимого файла | mkdir -p “/etc/containerd/registry.d/${REGISTRY_URL}” bb-sync-file “/etc/containerd/registry.d/${REGISTRY_URL}/hosts.toml” - « EOF [host] [host.”https://${REGISTRY_URL}”] capabilities = [“pull”, “resolve”] [host.”https://${REGISTRY_URL}”.auth] username = “username” password = “password” EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||
toml [host] Mirror 1 [host.”https://${REGISTRY_URL_1}”] capabilities = [“pull”, “resolve”] ca = [”${CERT_DIR}/${CERT_NAME}.crt”] | How to configure a certificate for an additional registry (new method)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
[host.”https://${REGISTRY_URL_1}”.auth] username = “${USERNAME}” password = “${PASSWORD}” | Example of configuring a certificate for an additional registry when using the new configuration method: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Mirror 2 [host.”http://${REGISTRY_URL_2}”] capabilities = [“pull”, “resolve”] skip_verify = true | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-tls.sh spec: The step can be arbitrary, as restarting the containerd service is not required weight: 0 bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Изменения конфигураций не приводят к перезапуску сервиса containerd. | mkdir -p “/etc/containerd/registry.d/${REGISTRY_URL}” | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как добавить авторизацию в дополнительный registry (новый способ)? | bb-sync-file “/etc/containerd/registry.d/${REGISTRY_URL}/ca.crt” - « EOF —–BEGIN CERTIFICATE—– … —–END CERTIFICATE—– EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример добавления авторизации в дополнительный registry при использовании нового способа конфигурации: | bb-sync-file “/etc/containerd/registry.d/${REGISTRY_URL}/hosts.toml” - « EOF [host] [host.”https://${REGISTRY_URL}”] capabilities = [“pull”, “resolve”] ca = [“/etc/containerd/registry.d/${REGISTRY_URL}/ca.crt”] EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-auth.sh spec: Шаг может быть любой, т.к. не требуется перезапуск сервиса containerd weight: 0 bundles:
| In addition to containerd, the certificate can be added into the OS. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
mkdir -p “/etc/containerd/registry.d/${REGISTRY_URL}” bb-sync-file “/etc/containerd/registry.d/${REGISTRY_URL}/hosts.toml” - « EOF [host] [host.”https://${REGISTRY_URL}”] capabilities = [“pull”, “resolve”] [host.”https://${REGISTRY_URL}”.auth] username = “username” password = “password” EOF | How to add TLS skip verify (new method)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как настроить сертификат для дополнительного registry (новый способ)? | Example of adding TLS skip verify when using the new configuration method: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример настройки сертификата для дополнительного registry? при использовании нового способа конфигурации: | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-skip-tls.sh spec: The step can be arbitrary, as restarting the containerd service is not required weight: 0 bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-tls.sh spec: Шаг может быть любой, тк не требуется перезапуск сервиса containerd weight: 0 bundles:
| mkdir -p “/etc/containerd/registry.d/${REGISTRY_URL}” bb-sync-file “/etc/containerd/registry.d/${REGISTRY_URL}/hosts.toml” - « EOF [host] [host.”https://${REGISTRY_URL}”] capabilities = [“pull”, “resolve”] skip_verify = true EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||
mkdir -p “/etc/containerd/registry.d/${REGISTRY_URL}” | After applying the configuration file, check access to the registry from the nodes using the following commands: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bb-sync-file “/etc/containerd/registry.d/${REGISTRY_URL}/ca.crt” - « EOF —–BEGIN CERTIFICATE—– … —–END CERTIFICATE—– EOF | bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bb-sync-file “/etc/containerd/registry.d/${REGISTRY_URL}/hosts.toml” - « EOF [host] [host.”https://${REGISTRY_URL}”] capabilities = [“pull”, “resolve”] ca = [“/etc/containerd/registry.d/${REGISTRY_URL}/ca.crt”] EOF | Via the CRI interface crictl pull private.registry.example/image/repo:tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Помимо containerd, сертификат можно добавить в операционную систему. | Via ctr with the configuration directory specified ctr -n k8s.io images pull –hosts-dir=/etc/containerd/registry.d/ private.registry.example/image/repo:tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как добавить TLS skip verify (новый способ)? | Via ctr for an HTTP registry ctr -n k8s.io images pull –hosts-dir=/etc/containerd/registry.d/ –plain-http private.registry.example/image/repo:tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример добавления TLS skip verify при использовании нового способа конфигурации: | How to use NodeGroup’s priority feature | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: containerd-additional-config-skip-tls.sh spec: Шаг может быть любой, тк не требуется перезапуск сервиса containerd weight: 0 bundles:
| The priority field of the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
mkdir -p “/etc/containerd/registry.d/${REGISTRY_URL}” bb-sync-file “/etc/containerd/registry.d/${REGISTRY_URL}/hosts.toml” - « EOF [host] [host.”https://${REGISTRY_URL}”] capabilities = [“pull”, “resolve”] skip_verify = true EOF | Here is an example of creating two | ||||||||||||||||||||||||||||||||||||||||||||||||||||
После применения конфигурационного файла проверьте доступ к registry с узлов, используя команды: | yamlapiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: worker-spot spec: cloudInstances: classReference: kind: AWSInstanceClass name: worker-spot maxPerZone: 5 minPerZone: 0 priority: 50 nodeType: CloudEphemeral — apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: worker spec: cloudInstances: classReference: kind: AWSInstanceClass name: worker maxPerZone: 5 minPerZone: 0 priority: 30 nodeType: CloudEphemeral | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash | In the above example, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Через cri интерфейс crictl pull private.registry.example/image/repo:tag | Once the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Через ctr с указанием директории с конфигурациями ctr -n k8s.io images pull –hosts-dir=/etc/containerd/registry.d/ private.registry.example/image/repo:tag | Note that node templates (labels/taints) for | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Через ctr для http репозитория ctr -n k8s.io images pull –hosts-dir=/etc/containerd/registry.d/ –plain-http private.registry.example/image/repo:tag | How to interpret Node Group states? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как использовать NodeGroup с приоритетом? | Ready — the node group contains the minimum required number of scheduled nodes with the status Ready for all zones. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
С помощью параметра priority кастомного ресурса | Example 1. A group of nodes in the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример создания двух | yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: ng1 spec: nodeType: CloudEphemeral cloudInstances: maxPerZone: 5 minPerZone: 1 status: conditions:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
yamlapiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: worker-spot spec: cloudInstances: classReference: kind: AWSInstanceClass name: worker-spot maxPerZone: 5 minPerZone: 0 priority: 50 nodeType: CloudEphemeral — apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: worker spec: cloudInstances: classReference: kind: AWSInstanceClass name: worker maxPerZone: 5 minPerZone: 0 priority: 30 nodeType: CloudEphemeral | Example 2. A group of nodes in the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
В приведенном выше примере, | yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: ng1 spec: nodeType: CloudEphemeral cloudInstances: maxPerZone: 5 minPerZone: 2 status: conditions:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
После того как NodeGroup | Updating — a node group contains at least one node in which there is an annotation with the prefix update.node.deckhouse.io (for example, update.node.deckhouse.io/waiting-for-approval). | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Шаблоны узлов (labels/taints) для NodeGroup | WaitingForDisruptiveApproval - a node group contains at least one node that has an annotation update.node.deckhouse.io/disruption-required and there is no annotation update.node.deckhouse.io/disruption-approved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как интерпретировать состояние группы узлов? | Scaling — calculated only for node groups with the type CloudEphemeral. The state True can be in two cases: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Ready — группа узлов содержит минимально необходимое число запланированных узлов с состоянием |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример 1. Группа узлов в состоянии | The desired number of nodes is the sum of all replicas in the node group. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: ng1 spec: nodeType: CloudEphemeral cloudInstances: maxPerZone: 5 minPerZone: 1 status: conditions:
| Example. The desired number of nodes is 2: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример 2. Группа узлов в состоянии | yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: ng1 spec: nodeType: CloudEphemeral cloudInstances: maxPerZone: 5 minPerZone: 2 status: … desired: 2 … | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: ng1 spec: nodeType: CloudEphemeral cloudInstances: maxPerZone: 5 minPerZone: 2 status: conditions:
| Error — contains the last error that occurred when creating a node in a node group. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Updating — группа узлов содержит как минимум один узел, в котором присутствует аннотация с префиксом | How do I make werf ignore the Ready conditions in a node group? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
WaitingForDisruptiveApproval — группа узлов содержит как минимум один узел, в котором присутствует аннотация | werf checks the Ready status of resources and, if available, waits for the value to become True. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Scaling — рассчитывается только для групп узлов с типом | Creating (updating) a nodeGroup resource in a cluster can take a significant amount of time to create the required number of nodes. When deploying such a resource in a cluster using werf (e.g., as part of a CI/CD process), deployment may terminate when resource readiness timeout is exceeded. To make werf ignore the nodeGroup status, the following | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| yaml metadata: annotations: werf.io/fail-mode: IgnoreAndContinueDeployProcess werf.io/track-termination-mode: NonBlocking | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Желаемое число узлов — это сумма всех реплик, входящих в группу узлов. | What is an Instance resource? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример. Желаемое число узлов равно 2: | An Instance resource contains a description of an implementation-independent ephemeral machine resource. For example, machines created by MachineControllerManager or Cluster API Provider Static will have a corresponding Instance resource. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: ng1 spec: nodeType: CloudEphemeral cloudInstances: maxPerZone: 5 minPerZone: 2 status: … desired: 2 … | The object does not contain a specification. The status contains: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Error — содержит последнюю ошибку, возникшую при создании узла в группе узлов. |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как заставить werf игнорировать состояние Ready в группе узлов? | When a machine is created/deleted, the Instance object is created/deleted accordingly. You cannot create an Instance resource yourself, but you can delete it. In this case, the machine will be removed from the cluster (the removal process depends on implementation details). | ||||||||||||||||||||||||||||||||||||||||||||||||||||
werf проверяет состояние | When is a node reboot required? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Создание (обновление) ресурса nodeGroup в кластере может потребовать значительного времени на развертывание необходимого количества узлов. При развертывании такого ресурса в кластере с помощью werf (например, в рамках процесса CI/CD) развертывание может завершиться по превышении времени ожидания готовности ресурса. Чтобы заставить werf игнорировать состояние | Node reboots may be required after configuration changes. For example, after changing certain sysctl settings, specifically when modifying the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml metadata: annotations: werf.io/fail-mode: IgnoreAndContinueDeployProcess werf.io/track-termination-mode: NonBlocking | How do I work with GPU nodes? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Что такое ресурс Instance? | GPU-node management is available in Enterprise Edition only. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Ресурс | Step-by-step procedure for adding a GPU node to the cluster | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Объект не содержит спецификации. Статус содержит: | Starting with Deckhouse 1.71, if a | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
При создании или удалении машины создается или удаляется соответствующий объект Instance.
Самостоятельно ресурс | Always specify the desired mode in | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Когда требуется перезагрузка узлов? | Manual containerd configuration (via | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Некоторые операции по изменению конфигурации узлов могут потребовать перезагрузки. | To add a GPU node to the cluster, perform the following steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Перезагрузка узла может потребоваться при изменении некоторых настроек sysctl, например, при изменении параметра |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как работать с GPU-узлами? | An example with TimeSlicing enabled ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Управление GPU-узлами доступно только в Enterprise Edition. | yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: gpu spec: nodeType: CloudStatic # or Static/CloudEphemeral — depending on your infrastructure gpu: sharing: TimeSlicing timeSlicing: partitionCount: 4 nodeTemplate: labels: node-role/gpu: “” taints:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Порядок действий по добавлению GPU-узла в кластер |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Начиная с Deckhouse 1.71, если в | Full field schema: see NodeGroup CR documentation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для корректной работы необходимо явно указать режим в | Install the NVIDIA driver and NVIDIA Container Toolkit on the nodes—either manually or via a NodeGroupConfiguration. Below are NodeGroupConfiguration examples for the gpu NodeGroup | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Ручная конфигурация containerd (через | Ubuntu | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Чтобы добавить GPU-узел в кластер, выполните следующие действия: | yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: install-cuda.sh spec: bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ ! -f “/etc/apt/sources.list.d/nvidia-container-toolkit.list” ]; then distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/libnvidia-container/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sudo tee /etc/apt/ sources.list.d/nvidia-container-toolkit.list fi bb-apt-install nvidia-container-toolkit nvidia-driver-535-server nvidia-ctk config –set nvidia-container-runtime.log-level=error –in-place nodeGroups:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример с включённым TimeSlicing ( | CentOS | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1 kind: NodeGroup metadata: name: gpu spec: nodeType: CloudStatic # или Static/CloudEphemeral — по вашей инфраструктуре gpu: sharing: TimeSlicing timeSlicing: partitionCount: 4 nodeTemplate: labels: node-role/gpu: “” taints:
| yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: install-cuda.sh spec: bundles:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ ! -f “/etc/yum.repos.d/nvidia-container-toolkit.repo” ]; then
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Полная схема полей находится в описании кастомного ресурса | After these configurations are applied, perform bootstrap and reboot the nodes so that settings are applied and the drivers get installed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Установку драйвера NVIDIA и NVIDIA Container Toolkit выполняйте на самих узлах — вручную или с помощью | bash nvidia-smi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Ubuntu | Expected healthy output (example): | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: install-cuda.sh spec: bundles:
| console root@k8s-dvp-w1-gpu:~# nvidia-smi Tue Aug 5 07:08:48 2025 +—————————————————————————————+ | NVIDIA-SMI 535.247.01 Driver Version: 535.247.01 CUDA Version: 12.2 | |—————————————–+———————-+———————-+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 Tesla V100-PCIE-32GB Off | 00000000:65:00.0 Off | 0 | | N/A 32C P0 35W / 250W | 0MiB / 32768MiB | 0% Default | | | | N/A | +—————————————–+———————-+———————-+ +—————————————————————————————+ | Processes: | | No running processes found | +—————————————————————————————+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
CentOS |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: deckhouse.io/v1alpha1 kind: NodeGroupConfiguration metadata: name: install-cuda.sh spec: bundles:
| NVIDIA Pods in | ||||||||||||||||||||||||||||||||||||||||||||||||||||
if [ ! -f “/etc/yum.repos.d/nvidia-container-toolkit.repo” ]; then
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
| bash kubectl -n d8-nvidia-gpu get pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||
После того как конфигурации будут применены, необходимо провести бутстрап и перезагрузить узлы, чтобы применить настройки и установить драйвера. | Expected healthy output (example): | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| console NAME READY STATUS RESTARTS AGE gpu-feature-discovery-80ceb7d-r842q 2/2 Running 0 2m53s nvidia-dcgm-exporter-w9v9h 1/1 Running 0 2m53s nvidia-dcgm-njqqb 1/1 Running 0 2m53s nvidia-device-plugin-80ceb7d-8xt8g 2/2 Running 0 2m53s | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash nvidia-smi | NFD Pods in | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Ожидаемый корректный вывод (пример): | bash kubectl -n d8-cloud-instance-manager get pods | egrep ‘^(NAME|node-feature-discovery)’ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
console root@k8s-dvp-w1-gpu:~# nvidia-smi Tue Aug 5 07:08:48 2025 +—————————————————————————————+ | NVIDIA-SMI 535.247.01 Driver Version: 535.247.01 CUDA Version: 12.2 | |—————————————–+———————-+———————-+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 Tesla V100-PCIE-32GB Off | 00000000:65:00.0 Off | 0 | | N/A 32C P0 35W / 250W | 0MiB / 32768MiB | 0% Default | | | | N/A | +—————————————–+———————-+———————-+ +—————————————————————————————+ | Processes: | | No running processes found | +—————————————————————————————+ | Expected healthy output (example): | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| console NAME READY STATUS RESTARTS AGE node-feature-discovery-gc-6d845765df-45vpj 1/1 Running 0 3m6s node-feature-discovery-master-74696fd9d5-wkjk4 1/1 Running 0 3m6s node-feature-discovery-worker-5f4kv 1/1 Running 0 3m8s | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Поды NVIDIA в | Resource exposure on the node: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash kubectl -n d8-nvidia-gpu get pod | bash
kubectl describe node | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Ожидаемый корректный вывод (пример): | Output snippet (example): | ||||||||||||||||||||||||||||||||||||||||||||||||||||
console NAME READY STATUS RESTARTS AGE gpu-feature-discovery-80ceb7d-r842q 2/2 Running 0 2m53s nvidia-dcgm-exporter-w9v9h 1/1 Running 0 2m53s nvidia-dcgm-njqqb 1/1 Running 0 2m53s nvidia-device-plugin-80ceb7d-8xt8g 2/2 Running 0 2m53s | console Capacity: cpu: 40 memory: 263566308Ki nvidia.com/gpu: 4 Allocatable: cpu: 39930m memory: 262648294441 nvidia.com/gpu: 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Поды NFD в |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash kubectl -n d8-cloud-instance-manager get pods | egrep ‘^(NAME|node-feature-discovery)’ | Option A. Invoke | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Ожидаемый корректный вывод (пример): | Create a Job: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
console NAME READY STATUS RESTARTS AGE node-feature-discovery-gc-6d845765df-45vpj 1/1 Running 0 3m6s node-feature-discovery-master-74696fd9d5-wkjk4 1/1 Running 0 3m6s node-feature-discovery-worker-5f4kv 1/1 Running 0 3m8s | yaml apiVersion: batch/v1 kind: Job metadata: name: nvidia-cuda-test namespace: default spec: completions: 1 template: spec: restartPolicy: Never nodeSelector: node.deckhouse.io/group: gpu containers:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Публикация ресурсов на узле: | Check the logs using the command: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash kubectl describe node <имя-ноды>имя-ноды> | bash kubectl logs job/nvidia-cuda-test | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Фрагмент вывода (пример): | Output example: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash Capacity: cpu: 40 memory: 263566308Ki nvidia.com/gpu: 4 Allocatable: cpu: 39930m memory: 262648294441 nvidia.com/gpu: 4 | console Tue Aug 5 07:48:02 2025 +—————————————————————————————+ | NVIDIA-SMI 535.247.01 Driver Version: 535.247.01 CUDA Version: 12.2 | |—————————————–+———————-+———————-+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 Tesla V100-PCIE-32GB Off | 00000000:65:00.0 Off | 0 | | N/A 31C P0 23W / 250W | 0MiB / 32768MiB | 0% Default | | | | N/A | +—————————————–+———————-+———————-+ +—————————————————————————————+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | No running processes found | +—————————————————————————————+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Option B. CUDA sample (vectoradd). | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Вариант A. Вызов | Create a Job: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Создайте в кластере задачу (Job): | yaml apiVersion: batch/v1 kind: Job metadata: name: gpu-operator-test namespace: default spec: completions: 1 template: spec: restartPolicy: Never nodeSelector: node.deckhouse.io/group: gpu containers:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: batch/v1 kind: Job metadata: name: nvidia-cuda-test namespace: default spec: completions: 1 template: spec: restartPolicy: Never nodeSelector: node.deckhouse.io/group: gpu containers:
| Check the logs using the command:: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Проверьте логи командой: | bash kubectl logs job/gpu-operator-test | ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash kubectl logs job/nvidia-cuda-test | Output example: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример вывода: | console [Vector addition of 50000 elements] Copy input data from the host memory to the CUDA device CUDA kernel launch with 196 blocks of 256 threads Copy output data from the CUDA device to the host memory Test PASSED Done | ||||||||||||||||||||||||||||||||||||||||||||||||||||
console Tue Aug 5 07:48:02 2025 +—————————————————————————————+ | NVIDIA-SMI 535.247.01 Driver Version: 535.247.01 CUDA Version: 12.2 | |—————————————–+———————-+———————-+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 Tesla V100-PCIE-32GB Off | 00000000:65:00.0 Off | 0 | | N/A 31C P0 23W / 250W | 0MiB / 32768MiB | 0% Default | | | | N/A | +—————————————–+———————-+———————-+ +—————————————————————————————+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | No running processes found | +—————————————————————————————+ | How to monitor GPUs? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Вариант B. CUDA sample (vectoradd). | Deckhouse Kubernetes Platform automatically deploys DCGM Exporter; GPU metrics are scraped by Prometheus and available in Grafana. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Создайте в кластере Job: | Which GPU modes are supported? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml apiVersion: batch/v1 kind: Job metadata: name: gpu-operator-test namespace: default spec: completions: 1 template: spec: restartPolicy: Never nodeSelector: node.deckhouse.io/group: gpu containers:
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Проверьте логи командой: | See examples in Examples → GPU nodes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shell kubectl logs job/gpu-operator-test | How to view available MIG profiles in the cluster? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Пример вывода: |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
console [Vector addition of 50000 elements] Copy input data from the host memory to the CUDA device CUDA kernel launch with 196 blocks of 256 threads Copy output data from the CUDA device to the host memory Test PASSED Done | Pre-defined profiles are stored in the | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как мониторить GPU? | bash kubectl -n d8-nvidia-gpu get cm mig-parted-config -o json | jq -r ‘.data[“config.yaml”]’ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Deckhouse Kubernetes Platform автоматически устанавливает DCGM Exporter; метрики GPU попадают в Prometheus и доступны в Grafana. | The | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Какие режимы работы GPU поддерживаются? | MIG profile does not activate — what to check? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Поддерживаются следующие режимы работы GPU: |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| yaml gpu: sharing: MIG mig: partedConfig: all-1g.5gb | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Примеры см. в разделе Примеры → GPU-узлы. |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Как посмотреть доступные MIG-профили в кластере? | This process can take several minutes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| While it is running, the node is tainted with | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Предустановленные профили находятся в ConfigMap |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
bash kubectl -n d8-nvidia-gpu get cm mig-parted-config -o json | jq -r ‘.data[“config.yaml”]’ |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
В разделе mig-configs вы увидите конкретные модели ускорителей (по PCI-ID) и список совместимых MIG-профилей для каждой из них.
Найдите свою видеокарту и выберите подходящий профиль — его имя указывается в |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Для GPU не активируется MIG-профиль — что проверить? | bash kubectl -n d8-nvidia-gpu logs daemonset/nvidia-mig-manager nvidia-smi -L | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Are AMD or Intel GPUs supported? | ||||||||||||||||||||||||||||||||||||||||||||||||||||
yaml gpu: sharing: MIG mig: partedConfig: all-1g.5gb | At this time, Deckhouse Kubernetes Platform automatically configures NVIDIA GPUs only. Support for AMD (ROCm) and Intel GPUs is being worked on and is planned for future releases. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
Этот процесс может занять несколько минут. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Пока операция идёт, на узле стоит taint | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
bash kubectl -n d8-nvidia-gpu logs daemonset/nvidia-mig-manager nvidia-smi -L | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Поддерживаются ли AMD или Intel GPU? | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Сейчас Deckhouse Kubernetes Platform автоматически настраивает только NVIDIA GPU. Поддержка AMD (ROCm) и Intel GPU находится в проработке и планируется к добавлению в будущих релизах. |