From f9e5d792c95380af29ee2d25c5a659bf72402e04 Mon Sep 17 00:00:00 2001 From: Ilya Kelim Date: Sun, 8 Dec 2024 18:01:13 +0200 Subject: [PATCH 1/2] Qick fix for mounting FileStore through k8s-cloud-init; --- modules/cloud-init/k8s-cloud-init.tftpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/cloud-init/k8s-cloud-init.tftpl b/modules/cloud-init/k8s-cloud-init.tftpl index b4c30c01..549f4224 100644 --- a/modules/cloud-init/k8s-cloud-init.tftpl +++ b/modules/cloud-init/k8s-cloud-init.tftpl @@ -4,7 +4,7 @@ runcmd: %{ 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 + - echo data /mnt/data virtiofs defaults 0 2 | sudo tee -a /etc/fstab %{ endif } %{ if enable_glusterfs != "false" } - sudo mkdir -p /mnt/glusterfs From c4265aba15223a5b59e620d68b45bd3bcbcc2e25 Mon Sep 17 00:00:00 2001 From: Elijah-K Date: Tue, 10 Dec 2024 11:59:44 +0200 Subject: [PATCH 2/2] Fix for mounting FileStore through k8s-cloud-init; --- modules/cloud-init/k8s-cloud-init.tftpl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/cloud-init/k8s-cloud-init.tftpl b/modules/cloud-init/k8s-cloud-init.tftpl index 549f4224..229246fc 100644 --- a/modules/cloud-init/k8s-cloud-init.tftpl +++ b/modules/cloud-init/k8s-cloud-init.tftpl @@ -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: