Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local SSD provision: use a single install command #601

Merged
merged 3 commits into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions manifests/gke/local-ssd-optimize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ spec:
value: |
#!/usr/bin/env bash
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
# Fix any issues
dpkg --configure -a
apt-get -y autoremove
apt-get update
apt-get install -y software-properties-common
apt-add-repository universe
# Avoid unecessary repository listings
test -f /etc/apt/sources.list.orig || cp /etc/apt/sources.list /etc/apt/sources.list.orig
cat /etc/apt/sources.list.orig | awk '/bionic main|bionic-updates main|bionic-updates universe/' > /etc/apt/sources.list
apt-get update
declare -a PKG_LIST=(python-google-compute-engine \
python3-google-compute-engine \
google-compute-engine-oslogin \
gce-compute-image-packages)
for pkg in ${PKG_LIST[@]}; do
apt-get install -y $pkg || echo "Not available: $pkg"
done
# Install required packages
apt-get install -y lvm2 python-google-compute-engine python3-google-compute-engine google-compute-engine-oslogin gce-compute-image-packages
# Restore original repository listings
cp /etc/apt/sources.list.orig /etc/apt/sources.list
mount | grep -v nobarrier | awk '/ssd/{print $1}' | xargs -i mount {} -o remount,nobarrier
volumeMounts:
- mountPath: /mnt/disks
Expand Down
24 changes: 9 additions & 15 deletions manifests/gke/local-ssd-provision/local-ssd-provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,18 @@ spec:

# Install the linux guest environment tools
export DEBIAN_FRONTEND=noninteractive
cat /etc/apt/sources.list
# Fix any issues
dpkg --configure -a
apt-get update
apt-get install -y software-properties-common || echo "could not install software-properties-common"
apt-add-repository universe
apt-get update
declare -a PKG_LIST=(python-google-compute-engine \
python3-google-compute-engine \
google-compute-engine-oslogin \
gce-compute-image-packages)
for pkg in ${PKG_LIST[@]}; do
apt-get install -y $pkg || echo "Not available: $pkg"
done

apt-get install -y lvm2
apt-get -y autoremove
# Avoid unecessary repository listings
test -f /etc/apt/sources.list.orig || cp /etc/apt/sources.list /etc/apt/sources.list.orig
cat /etc/apt/sources.list.orig | awk '/bionic main|bionic-updates main|bionic-updates universe/' > /etc/apt/sources.list
apt-get update
# Install required packages
apt-get install -y lvm2 python-google-compute-engine python3-google-compute-engine google-compute-engine-oslogin gce-compute-image-packages
# Restore original repository listings
cp /etc/apt/sources.list.orig /etc/apt/sources.list

set -x
if ! findmnt -n -a -l | grep /mnt/disks/ssd ; then
if test -f /etc/ssd_mounts ; then
ssd_mounts=$(cat /etc/ssd_mounts)
Expand Down