datashim-io / datashim

A kubernetes based framework for hassle free handling of datasets
http://datashim-io.github.io/datashim
Apache License 2.0
481 stars 68 forks source link

Automount option #354

Closed fcollonval closed 5 months ago

fcollonval commented 6 months ago

The current behavior is to mount a dataset in all containers - including init containers.

It is also possible to specify a custom mount point as in that example. But the default mount point is also created (see pod description below).

Would you consider adding a new label or a new value for the useas label (something like manualMount) to defer the mount point definition to the datashim consumer?

From current pod description:

Start Time:       Mon, 06 May 2024 11:02:53 +0200
Labels:           dataset.0.id=dataset-images-content
                  dataset.0.useas=mount
                  ...
Annotations:      ...
Status:           Running
Init Containers:
  init-container-1:
    ...
    Mounts:
      /mnt/datasets/dataset-images-content from dataset-images-content (rw)
  init-container-2:
    ...
    Mounts:
      /mnt/datasets/dataset-images-content from dataset-images-content (rw)
Containers:
  container-1:
    ...
    Mounts:
      /mnt/datasets/dataset-images-content from dataset-images-content (rw)
  container-2:
    Mounts:
      ...
      /mnt/datasets/dataset-images-content from dataset-images-content (rw)
      /var/data/images from dataset-images-content (rw)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  ...
  dataset-images-content:
    Type:        PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:   dataset-images-content
    ReadOnly:    false
srikumar003 commented 6 months ago

@fcollonval You've spotted a bug in the operator. If the mount point is overriden in the podspec as in the example, then the default mount points should not be created. Will issue a fix soon