Skip to content

Commit

Permalink
✨ feat: propagate node data dir customization into task file and conf…
Browse files Browse the repository at this point in the history
…igurations

Signed-off-by: Muhammed Hussein Karimi <[email protected]>
  • Loading branch information
mhkarimi1383 authored and stephanosio committed Feb 28, 2024
1 parent ee137d0 commit 6fa2fe5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions deploy/charts/rawfile-csi/templates/01-controller-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ spec:
value: "{{ .Values.provisionerName }}"
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: NODE_DATADIR
value: "{{ .Values.node.dataDirPath }}"
- name: IMAGE_REPOSITORY
value: "{{ include "rawfile-csi.controller-image-repository" . }}"
{{- if regexMatch "^.*-ci$" (include "rawfile-csi.controller-image-tag" .) }}
Expand Down
2 changes: 2 additions & 0 deletions deploy/charts/rawfile-csi/templates/01-node-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
env:
- name: PROVISIONER_NAME
value: "{{ .Values.provisionerName }}"
- name: NODE_DATADIR
value: "{{ .Values.node.dataDirPath }}"
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: IMAGE_REPOSITORY
Expand Down
1 change: 1 addition & 0 deletions orchestrator/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def run_on_node(fn, node):
"cmd": json.dumps(fn),
"image_repository": CONFIG["image_repository"],
"image_tag": CONFIG["image_tag"],
"datadir": CONFIG["node_datadir"]
}
template = Path("./templates/task.yaml").read_bytes().decode()
manifest = template.format(**ctx)
Expand Down
4 changes: 3 additions & 1 deletion rawfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
@click.group()
@click.option("--image-repository", envvar="IMAGE_REPOSITORY")
@click.option("--image-tag", envvar="IMAGE_TAG")
def cli(image_repository, image_tag):
@click.option("--node-datadir", envvar="NODE_DATADIR")
def cli(image_repository, image_tag, node_datadir):
CONFIG["image_repository"] = image_repository
CONFIG["image_tag"] = image_tag
CONFIG["node_datadir"] = node_datadir


@cli.command()
Expand Down
2 changes: 1 addition & 1 deletion 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: {datadir}
type: DirectoryOrCreate
nodeSelector: {nodeSelector}
containers:
Expand Down

0 comments on commit 6fa2fe5

Please sign in to comment.