Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Revert "packet: Always mount node local storage on /mnt/"
Browse files Browse the repository at this point in the history
This reverts commit 7c4b6bc.
  • Loading branch information
rata committed Sep 27, 2019
1 parent 7c4b6bc commit a85b8d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
24 changes: 11 additions & 13 deletions packet/flatcar-linux/kubernetes/workers/cl/worker.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@ storage:

if [ "$${setup_fs_on_raid}" = true ]; then
mkfs.ext4 "$${device_path}"
mount "$${device_path}" "/mnt/"
mkdir "/mnt/$${array_name}"
mount "$${device_path}" "/mnt/$${array_name}"
# Make mount persistent across reboots
echo "$${device_path} /mnt/ ext4 defaults,nofail,discard 0 0" | tee -a /etc/fstab
echo "$${device_path} /mnt/$${array_name} ext4 defaults,nofail,discard 0 0" | tee -a /etc/fstab
fi
}

Expand All @@ -210,20 +211,17 @@ storage:
# https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
major_numbers="8,259"

# XXX: These options are exclusive, as only one fs can be mounted
# to /mnt/
# This is, partly, because when creating dirs inside /mnt to mount
# several paths (like /mnt/node-local-storage), those are not visible
# to the pods. See this issue for more info:
# https://github.com/kinvolk/lokomotive-kubernetes/issues/73
#
# Variables replaced by Terraform
if [ ${setup_raid} = true ]; then
create_data_raid "$${major_numbers}" -1 /dev/md/node-local-storage true
elif [ ${setup_raid_hdd} = true ]; then
create_data_raid "$${major_numbers}" 1 /dev/md/node-local-hdd-storage true
elif [ ${setup_raid_ssd} = true ]; then
create_data_raid "$${major_numbers}" 0 /dev/md/node-local-ssd-storage ${setup_raid_ssd_fs}
else
# Both can be set independently
if [ ${setup_raid_hdd} = true ]; then
create_data_raid "$${major_numbers}" 1 /dev/md/node-local-hdd-storage true
fi
if [ ${setup_raid_ssd} = true ]; then
create_data_raid "$${major_numbers}" 0 /dev/md/node-local-ssd-storage ${setup_raid_ssd_fs}
fi
fi
- path: /etc/kubernetes/kubeconfig
filesystem: root
Expand Down
6 changes: 3 additions & 3 deletions packet/flatcar-linux/kubernetes/workers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ EOD
}

variable "setup_raid" {
description = "Attempt to create a RAID 0 from extra disks to be used for persistent container storage. Can't be used with setup_raid_hdd nor setup_raid_sdd. Valid values: \"true\", \"false\""
description = "Attempt to create a RAID 0 from extra disks to be used for persistent container storage. Valid values: \"true\", \"false\""
type = "string"
default = "false"
}

variable "setup_raid_hdd" {
description = "Attempt to create a RAID 0 from extra Hard Disk drives only, to be used for persistent container storage. Can't be used with setup_raid nor setup_raid_sdd. Valid values: \"true\", \"false\""
description = "Attempt to create a RAID 0 from extra Hard Disk drives only, to be used for persistent container storage. Valid values: \"true\", \"false\""
type = "string"
default = "false"
}

variable "setup_raid_ssd" {
description = "Attempt to create a RAID 0 from extra Solid State Drives only, to be used for persistent container storage. Can't be used with setup_raid nor setup_raid_hdd. Valid values: \"true\", \"false\""
description = "Attempt to create a RAID 0 from extra Solid State Drives only, to be used for persistent container storage. Valid values: \"true\", \"false\""
type = "string"
default = "false"
}
Expand Down

0 comments on commit a85b8d4

Please sign in to comment.