Skip to content

Commit 2e21918

Browse files
committed
feat(module): add nodeSelector for workload
Signed-off-by: Pavel Tishkov <[email protected]>
1 parent 9bc3fde commit 2e21918

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

openapi/config-values.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
type: object
22
required: [virtualMachineCIDRs, dvcr]
33
properties:
4+
compute:
5+
type: object
6+
description: |
7+
Common compute settings.
8+
default: {}
9+
properties:
10+
nodeSelector:
11+
type: object
12+
default:
13+
kubernetes.io/os: linux
14+
additionalProperties:
15+
type: string
16+
description: |
17+
The same as in the Pods `spec.nodeSelector` parameter in Kubernetes.
18+
19+
Node labels are used to schedule control plane components that require hardware virtualization support (VMX for Intel CPUs or SVM for AMD CPUs) and are responsible for managing the lifecycle of virtual machines (VMs).
20+
As a result, only nodes matching this selector will be able to run virtual machines.
21+
22+
If omitted, the default value `kubernetes.io/os=linux` is used.
23+
To enable VMs to run on all compatible nodes, simply leave this field unset.
424
highAvailability:
525
type: boolean
626
x-examples: [true, false]

openapi/doc-ru-config-values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
type: object
22
properties:
3+
workload:
4+
description: |
5+
Общие настройки рабочей нагрузки.
6+
properties:
7+
nodeSelector:
8+
description: |
9+
Аналогично параметру `spec.nodeSelector` в Kubernetes.
10+
11+
Метки узлов используются для планирования компонентов плоскости управления, которые требуют поддержки аппаратной виртуализации (VMX для процессоров Intel или SVM для процессоров AMD) и отвечают за управление жизненным циклом виртуальных машин.
12+
В результате только узлы, соответствующие этому селектору, смогут запускать виртуальные машины.
13+
14+
Если этот параметр опущен, используется значение по умолчанию `kubernetes.io/os=linux`.
15+
Чтобы позволить виртуальным машинам запускаться на всех совместимых узлах, просто оставьте это поле без значения.
316
highAvailability:
417
description: |
518
Ручное управление режимом отказоустойчивости.

templates/kubevirt/kubevirt.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{{- $nodeSelectorMaster := index (include "helm_lib_node_selector" (tuple . "master") | fromYaml) "nodeSelector" | default (dict) | toJson }}
33
{{- $tolerationsSystem := index (include "helm_lib_tolerations" (tuple . "system") | fromYaml) "tolerations" | default (list) | toJson }}
44
{{- $tolerationsAnyNode := index (include "helm_lib_tolerations" (tuple . "any-node") | fromYaml) "tolerations" | default (list) | toJson }}
5+
{{- $virtHandlerNodeSelector := dig "compute" "nodeSelector" nil .Values.virtualization | default (dict "kubernetes.io/os" "linux") | toJson }}
56
{{- $priorityClassName := "" | quote }}
67
{{- if (.Values.global.enabledModules | has "priority-class") }}
78
{{- $priorityClassName = include "priorityClassName" . | quote }}
@@ -85,6 +86,10 @@ spec:
8586
resourceName: virt-handler
8687
patch: '[{"op":"replace","path":"/spec/template/spec/tolerations","value":{{ $tolerationsAnyNode }}}]'
8788
type: json
89+
- patch: '[{"op":"replace","path":"/spec/template/spec/nodeSelector","value":{{ $virtHandlerNodeSelector }}}]'
90+
resourceName: virt-handler
91+
resourceType: DaemonSet
92+
type: json
8893
{{- if (include "helm_lib_ha_enabled" .) }}
8994
- resourceType: Deployment
9095
resourceName: virt-api

0 commit comments

Comments
 (0)