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

Support volume mounts (e.g. nfs) for Kubernetes #658

Open
sjawhar opened this issue Sep 5, 2022 · 3 comments
Open

Support volume mounts (e.g. nfs) for Kubernetes #658

sjawhar opened this issue Sep 5, 2022 · 3 comments
Labels
cloud-k8s Kubernetes enhancement New feature or request external-request You asked, we did storage

Comments

@sjawhar
Copy link
Contributor

sjawhar commented Sep 5, 2022

Requested Functionality

If you're using k8s as your compute environment and you're operating on-prem, it's quite likely that you also have some kind of shared storage system (e.g. NFS). The user should be able to specify such volume mounts for their TPI task.

Candidate Implementation

See master...sjawhar:terraform-provider-iterative:feature/nfs-volume#diff-0fe990bc324a7948aa5a28972474908770afb9f012a7d0586ee0b4af8f808d8eR200-R216

Relevant section in TF would look like this:

resource "iterative_task" "task_with_nfs_volume" {
  cloud = "k8s"
  nfs_volume {
    server      = "10.0.20.3"
    server_path = "/data/projects"
    mount_path  = "/projects"
  }
}
@0x2b3bfa0
Copy link
Member

Isn't a StorageClass the traditional approach to solve this use case? 🤔

@sjawhar
Copy link
Contributor Author

sjawhar commented Sep 19, 2022

Isn't a StorageClass the traditional approach to solve this use case? thinking

I don't think so? I based my implementation on the Kubernetes plugin for Jenkins, which generates pod specs that look like this:

apiVersion: "v1"
kind: "Pod"
spec:
  containers:
  - command:
    - "/bin/bash"
    image: "python3.9"
    volumeMounts:
    - mountPath: "/mount/path/here"
      name: "volume-0"
      readOnly: false
    workingDir: "/home/jenkins/agent"
  nodeSelector:
    nodetype: "cpu"
  restartPolicy: "Never"
  volumes:
  - name: "volume-0"
    nfs:
      path: "/server/path/here"
      readOnly: true
      server: "10.0.20.3"

@casperdcl casperdcl added external-request You asked, we did enhancement New feature or request storage cloud-k8s Kubernetes labels Oct 14, 2022
@0x2b3bfa0
Copy link
Member

Would an option to use a ReadWriteMany PVC solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud-k8s Kubernetes enhancement New feature or request external-request You asked, we did storage
Projects
None yet
Development

No branches or pull requests

3 participants