Skip to content

Commit

Permalink
Do not prepare local disks by default (awslabs#1686)
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermckinnon authored and atmosx committed Jun 18, 2024
1 parent e932012 commit 65b6ef4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Before=containerd.service kubelet.service

[Service]
Type=oneshot
ExecStart=/usr/bin/setup-local-disks raid0
Environment=LOCAL_DISK_STRATEGY=none
ExecStart=/usr/bin/setup-local-disks $LOCAL_DISK_STRATEGY

[Install]
WantedBy=multi-user.target
11 changes: 8 additions & 3 deletions templates/shared/runtime/bin/setup-local-disks
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ err_report() {
trap 'err_report $LINENO' ERR

print_help() {
echo "usage: $0 <raid0 | mount>"
echo "usage: $0 <raid0 | mount | none>"
echo "Sets up Amazon EC2 Instance Store NVMe disks"
echo ""
echo "-d, --dir directory to mount the filesystem(s) (default: /mnt/k8s-disks/)"
Expand Down Expand Up @@ -193,11 +193,16 @@ set -- "${POSITIONAL[@]}" # restore positional parameters
DISK_SETUP="$1"
set -u

if [[ "${DISK_SETUP}" != "raid0" && "${DISK_SETUP}" != "mount" ]]; then
echo "Valid disk setup options are: raid0 or mount"
if [[ "${DISK_SETUP}" != "raid0" && "${DISK_SETUP}" != "mount" && "${DISK_SETUP}" != "none" ]]; then
echo "Valid disk setup options are: raid0, mount, or none"
exit 1
fi

if [ "${DISK_SETUP}" = "none" ]; then
"disk setup is 'none', nothing to do!"
exit 0
fi

if [ ! -d /dev/disk/by-id/ ]; then
echo "no ephemeral disks found!"
exit 0
Expand Down

0 comments on commit 65b6ef4

Please sign in to comment.