Skip to content

Commit

Permalink
Merge pull request #110 from nebius/fix/k8s-cloudinit-filestore-mount…
Browse files Browse the repository at this point in the history
…-quickfix

Qick fix for mounting FileStore through k8s-cloud-init;
  • Loading branch information
elijah-k-nebius authored Dec 10, 2024
2 parents 8d20522 + c4265ab commit 5e5640d
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions modules/cloud-init/k8s-cloud-init.tftpl
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
%{ if enable_filestore != "false" || enable_glusterfs != "false" }
runcmd:
mounts:
%{ endif }
%{ if enable_filestore != "false" }
- sudo mkdir -p /mnt/data
- sudo mount -t virtiofs data /mnt/data
- echo data /mnt/data \"virtiofs\" \"defaults\" \"0\" \"2\" | sudo tee -a /etc/fstab
- [ data, /mnt/data, virtiofs, "defaults", 0, 2 ]
%{ endif }
%{ if enable_glusterfs != "false" }
- sudo mkdir -p /mnt/glusterfs
- sudo apt-get install -y glusterfs-client
- sudo mount -t glusterfs ${glusterfs_host}:${glusterfs_volume} /mnt/glusterfs
- echo ${glusterfs_host}:${glusterfs_volume} /mnt/glusterfs "glusterfs" "defaults" "0" "2" | sudo tee -a /etc/fstab
- [ '${glusterfs_host}:${glusterfs_volume}', /mnt/glusterfs, glusterfs, "defaults,nofail", 0, 2 ]

packages:
- glusterfs-client

runcmd:
- [ modprobe, fuse ]
- [ mkdir, '-p', /mnt/data ]
- [ mount, '-a' ]

%{ endif }

users:
Expand Down

0 comments on commit 5e5640d

Please sign in to comment.