seaweedfs-csi-driver icon indicating copy to clipboard operation
seaweedfs-csi-driver copied to clipboard

Simplify Helm Charts for Maximum Flexibility

Open washcycle opened this issue 1 year ago • 0 comments

Right now, folks are hardcoding their specific use cases into the helm charts creating spaghetti code.

I propose a refactoring to pull all parameters into the values.yaml

e.g.

possible values.yaml definition

container:
  args:
    - "--endpoint=$(CSI_ENDPOINT)"
    - "--filer=$(SEAWEEDFS_FILER)"
    - "--nodeid=$(NODE_ID)"
    - "--cacheDir=/var/cache/seaweedfs"
    - "--concurrentWriters=10"
    - "--cacheSizeMB=2024"

helm template simplifies from

          args:
           - "--endpoint=$(CSI_ENDPOINT)"
           - "--filer=$(SEAWEEDFS_FILER)"
           - "--nodeid=$(NODE_ID)"
           - "--cacheDir=/var/cache/seaweedfs"
           - "--dataLocality={{ .Values.dataLocality }}"
           - "--concurrentWriters=10"
           # {{- if .Values.node.injectTopologyInfoFromNodeLabel.enabled }}
           # - "--dataCenter=$(DATACENTER)"
           # {{- end }}

to

          args:
            {{- toYaml .Values.container.args | nindent 12 }}        

Then each individual can add things like data locality without breaking the base helm templates for others. This also makes it forward compatible with any parameter additions. Just update the image and the values.yaml with the new parameter you want to use.

Would need to do this modification for annotations, labels, envs, persistence storage etc.

washcycle avatar Apr 12 '23 20:04 washcycle