Skip to content

Commit

Permalink
Add user node selector for data nodes (#31)
Browse files Browse the repository at this point in the history
Signed-off-by: v.oleynikov <vasily.oleynikov@flant.com>
  • Loading branch information
duckhawk authored Apr 22, 2024
1 parent 594435d commit 0c3955b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
17 changes: 17 additions & 0 deletions openapi/config-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 10 additions & 0 deletions templates/sds-local-volume-controller/secret.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 2 additions & 0 deletions templates/sds-local-volume-csi/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0c3955b

Please sign in to comment.