Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: make data dir configurable #4

6 changes: 4 additions & 2 deletions deploy/charts/rawfile-csi/templates/01-node-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
type: DirectoryOrCreate
- name: data-dir
hostPath:
path: /var/csi/rawfile
path: {{ .Values.node.rawfile_dir }}
type: DirectoryOrCreate
containers:
- name: csi-driver
Expand All @@ -66,6 +66,8 @@ spec:
value: unix:///csi/csi.sock
- name: IMAGE_REPOSITORY
value: "{{ .Values.node.image.repository }}"
- name: DATA_DIR
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "remove data_dir variable" applies to this one too

value: "{{ .Values.node.data_dir }}"
{{- if regexMatch "^.*-ci$" .Values.node.image.tag }}
- name: IMAGE_TAG
value: "{{ .Values.node.image.tag }}"
Expand All @@ -85,7 +87,7 @@ spec:
mountPath: /var/lib/kubelet
mountPropagation: "Bidirectional"
- name: data-dir
mountPath: /data
mountPath: {{ .Values.node.data_dir }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

resources:
{{- toYaml .Values.node.resources | nindent 12 }}
- name: node-driver-registrar
Expand Down
4 changes: 4 additions & 0 deletions deploy/charts/rawfile-csi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ defaults: &defaults
requests:
cpu: 10m
memory: 100Mi
rawfile_dir: /var/csi/rawfile
data_dir: /data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto




controller:
<< : *defaults
Expand Down
4 changes: 2 additions & 2 deletions templates/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
volumes:
- name: data-dir
hostPath:
path: /var/csi/rawfile
path: {rawfile_dir}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this needs to be passed into the templating function so that it can get rendered.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
can i change it into templating function like this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values are interpolated not by helm, but the python code. So that's where the code needs to be updated.

type: DirectoryOrCreate
nodeSelector: {nodeSelector}
containers:
Expand All @@ -20,7 +20,7 @@ spec:
imagePullPolicy: IfNotPresent
volumeMounts:
- name: data-dir
mountPath: /data
mountPath: {data_dir}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

resources:
requests: &rsc
cpu: 10m
Expand Down