Skip to content

Commit

Permalink
update mount options for GCP (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
cofyc authored Aug 27, 2019
1 parent 43f77aa commit 3534fa5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions manifests/gke/local-ssd-provision/local-ssd-provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ spec:
set -euo pipefail
set -x
# discard,nobarrier are required to optimize local SSD
# performance in GCP, see
# https://cloud.google.com/compute/docs/disks/performance#optimize_local_ssd
mnt_opts="defaults,nodelalloc,noatime,discard,nobarrier"
# use /var because it is writeable on COS
if ! findmnt -n -a -l | grep /mnt/disks/ssd ; then
if test -f /var/ssd_mounts ; then
Expand Down Expand Up @@ -128,9 +133,9 @@ spec:
mnt_dir="/mnt/disks/$uuid"
mkdir -p "$mnt_dir"
if ! grep "$uuid" /etc/fstab ; then
echo "UUID=$uuid $mnt_dir ext4 rw,relatime,discard,nobarrier,data=ordered" >> /etc/fstab
echo "UUID=$uuid $mnt_dir ext4 $mnt_opts" >> /etc/fstab
fi
mount -U "$uuid" -t ext4 --target "$mnt_dir" --options 'rw,relatime,discard,nobarrier,data=ordered'
mount -U "$uuid" -t ext4 --target "$mnt_dir" --options "$mnt_opts"
chmod a+w "$mnt_dir"
fi
done
Expand Down Expand Up @@ -173,9 +178,9 @@ spec:
mkdir -p "$mnt_dir"
if ! grep "$uuid" /etc/fstab ; then
echo "UUID=$uuid $mnt_dir ext4 rw,relatime,discard,nobarrier,data=ordered" >> /etc/fstab
echo "UUID=$uuid $mnt_dir ext4 $mnt_opts" >> /etc/fstab
fi
mount -U "$uuid" -t ext4 --target "$mnt_dir" --options 'rw,relatime,discard,nobarrier,data=ordered'
mount -U "$uuid" -t ext4 --target "$mnt_dir" --options "$mnt_opts"
chmod a+w "$mnt_dir"
containers:
- image: "quay.io/external_storage/local-volume-provisioner:v2.3.2"
Expand Down

0 comments on commit 3534fa5

Please sign in to comment.