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

What is the official/conventional way of creating the volumes in a CSI plugin? #30

Open
mbtamuli opened this issue Dec 31, 2023 · 0 comments

Comments

@mbtamuli
Copy link
Owner

Goal

  • Find out what is the official/conventional way to create the volumes
    • same volume as CSI
    • separate volume

Background

Ref: #25 (comment)

  • A volume mounted from the host in both the plugin container and the node-driver-registrar container, which is used primarily for the CSI socket
    spec:
      template:
        spec:
          containers:
            - volumeMounts:
                - mountPath: /csi
                  name: plugin-dir
          volumes:
            - hostPath:
                path: /var/lib/kubelet/plugins/emptydirclone.mriyam.dev
                type: DirectoryOrCreate
              name: plugin-dir
  • The plugin creating a volume, that gets mounted at the target path as requested by kubelet. Now the path that the plugin uses for creating the volume lives under the path /csi
     // getVolumePath returns the canonical path for emptydirclone volume
     func getVolumePath(volName string) string {
     	return filepath.Join("/csi/data", volName)
     }

Although this works, the pattern I've seen is,

  • A volume separate from the one used for the CSI socket mounted from the host in both the plugin container and the node-driver-registrar container
    spec:
      template:
        spec:
          containers:
            - volumeMounts:
              - mountPath: /csi-data-dir
                name: csi-data-dir
        volumes:
          - hostPath:
              path: /var/lib/csi-emptydirclone.mriyam.dev-data/
              type: DirectoryOrCreate
            name: csi-data-dir
  • The plugin uses the volume /csi-data-dir/ to create all volumes within that path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant