Skip to content

Simplify Helm Charts for Maximum Flexibility #116

Open
@washcycle

Description

@washcycle

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions