mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 06:15:45 +00:00
AWS: Wait for disk to be attached in setup-master-pd.sh
This commit is contained in:
parent
6e09cd3ffd
commit
a3cb84fa56
@ -17,6 +17,18 @@
|
|||||||
# Format and mount the disk, create directories on it for all of the master's
|
# Format and mount the disk, create directories on it for all of the master's
|
||||||
# persistent data, and link them to where they're used.
|
# persistent data, and link them to where they're used.
|
||||||
|
|
||||||
|
echo "Waiting for master pd to be attached"
|
||||||
|
attempt=0
|
||||||
|
while true; do
|
||||||
|
echo Attempt "$(($attempt+1))" to check for /dev/xvdb
|
||||||
|
if [[ -e /dev/xvdb ]]; then
|
||||||
|
echo "Found /dev/xvdb"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
attempt=$(($attempt+1))
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
# Mount Master Persistent Disk
|
# Mount Master Persistent Disk
|
||||||
echo "Mounting master-pd"
|
echo "Mounting master-pd"
|
||||||
mkdir -p /mnt/master-pd
|
mkdir -p /mnt/master-pd
|
||||||
|
@ -836,7 +836,7 @@ function kube-up {
|
|||||||
wait-for-instance-running $master_id
|
wait-for-instance-running $master_id
|
||||||
|
|
||||||
# This is a race between instance start and volume attachment. There appears to be no way to start an AWS instance with a volume attached.
|
# This is a race between instance start and volume attachment. There appears to be no way to start an AWS instance with a volume attached.
|
||||||
# TODO: Wait for volume to be ready in setup-master-pd.sh
|
# To work around this, we wait for volume to be ready in setup-master-pd.sh
|
||||||
echo "Attaching peristent data volume (${MASTER_DISK_ID}) to master"
|
echo "Attaching peristent data volume (${MASTER_DISK_ID}) to master"
|
||||||
$AWS_CMD attach-volume --volume-id ${MASTER_DISK_ID} --device /dev/sdb --instance-id ${master_id}
|
$AWS_CMD attach-volume --volume-id ${MASTER_DISK_ID} --device /dev/sdb --instance-id ${master_id}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user