christian-schlichtherle / synology-csi-chart

A Helm chart for installing the Synology CSI Driver in a Kubernetes cluster.
Apache License 2.0
47 stars 18 forks source link

[Enhancement] consider adding tolerations/nodeaffinity configuration #2

Closed macgregor closed 1 year ago

macgregor commented 2 years ago

First off, thanks a ton for creating this. Great job! Hopefully the synology folks pick it up and run with it.

Many helm charts provide the ability to set tolerations and node affinity of the components they create. For example, if I wanted to make sure the synology-csi controller runs on my control plane nodes and not worker nodes I'd add the following values (particular values are specific to my infrastructure, obviously):

# infra nodes have "CriticalAddonsOnly" taint to ensure application workloads arent scheduled there
tolerations:
- key: "CriticalAddonsOnly"
  operator: "Equal"
  value: "true"
  effect: "NoExecute"

# try to schedule on control-plane nodes first
affinity:
  nodeAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: node-role.kubernetes.io/control-plane
          operator: In
          values:
          - 'true'

This may even be considered a non-starter for any but the most trivial kubernetes clusters. I'm not sure if some of the synology-csi components are meant to be running on all nodes on a cluster. It seems to be working fine on my two node cluster even though everything is deployed to the worker node due to taints on the master, but im still getting things up and running.

Here is an example in oath2-proxy.

christian-schlichtherle commented 2 years ago

First of all, please accept my apologies for the very late response.

Well, I'm not sure anybody would really need iSCSI volumes on control-plane nodes because none of the predefined workloads (e.g. Core DNS) requires them in the first place, but... you are right that this should be supported anyway so that it could be used in similar use cases. Would you mind sending a PR?

macgregor commented 1 year ago

I ended up switching to democratic-csi and simple nfs volumes due to synology's rather severe LUN limitations and some other usability issues i encountered trying to use iscsi.

christian-schlichtherle commented 1 year ago

In release 0.6.0, support for affinity, nodeSelector and tolerations was added.