diff --git a/openapi/config-values.yaml b/openapi/config-values.yaml index 3df12b6a..b7afa86b 100644 --- a/openapi/config-values.yaml +++ b/openapi/config-values.yaml @@ -12,3 +12,20 @@ properties: - TRACE description: Module log level default: DEBUG + dataNodes: + type: object + description: Settings for local volumes csi on nodes with data + default: {} + properties: + nodeSelector: + type: object + default: + kubernetes.io/os: linux + additionalProperties: + type: string + description: | + The same as in the Pods `spec.nodeSelector` parameter in Kubernetes. + + If parameter is omitted, local volume csi will be placed on all nodes. + + **Caution!** Changing this parameter does not result in data redistribution. If node with data no longer matches the `nodeSelector`, data on that node will become inaccessible. diff --git a/templates/sds-local-volume-controller/secret.yaml b/templates/sds-local-volume-controller/secret.yaml new file mode 100644 index 00000000..a232fabd --- /dev/null +++ b/templates/sds-local-volume-controller/secret.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: v1 +kind: Secret +metadata: + name: d8-{{ .Chart.Name }}-controller-config + namespace: d8-{{ .Chart.Name }} +type: Opaque +stringData: + config: |- + nodeSelector: {{ .Values.sdsLocalVolume.dataNodes.nodeSelector | toYaml | nindent 6 }} diff --git a/templates/sds-local-volume-csi/controller.yaml b/templates/sds-local-volume-csi/controller.yaml index 2419552f..422f38c1 100644 --- a/templates/sds-local-volume-csi/controller.yaml +++ b/templates/sds-local-volume-csi/controller.yaml @@ -156,6 +156,8 @@ spec: {{- include "helm_lib_tolerations" (tuple . "any-node" "storage-problems") | nindent 6 }} {{- include "helm_lib_priority_class" (tuple . "cluster-medium") | nindent 6 }} {{- include "helm_lib_module_pod_security_context_run_as_user_root" . | nindent 6 }} + nodeSelector: + storage.deckhouse.io/sds-local-volume-node: "" affinity: {} containers: - args: