mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-23 02:26:52 +00:00
AWS kube-up: Put the master-pd into /etc/fstab, to mount it early
Otherwise we risk services coming up on the master before the backing volume is ready. If we then see the master-pd is already mounted, don't try to remount it. Issue #21155
This commit is contained in:
parent
b5c12d10b8
commit
affffdc9ab
@ -52,6 +52,11 @@ remove-docker-artifacts() {
|
|||||||
|
|
||||||
# Finds the master PD device
|
# Finds the master PD device
|
||||||
find-master-pd() {
|
find-master-pd() {
|
||||||
|
if ( grep "/mnt/master-pd" /proc/mounts ); then
|
||||||
|
echo "Master PD already mounted; won't remount"
|
||||||
|
MASTER_PD_DEVICE=""
|
||||||
|
return
|
||||||
|
fi
|
||||||
echo "Waiting for master pd to be attached"
|
echo "Waiting for master pd to be attached"
|
||||||
attempt=0
|
attempt=0
|
||||||
while true; do
|
while true; do
|
||||||
@ -64,6 +69,9 @@ find-master-pd() {
|
|||||||
attempt=$(($attempt+1))
|
attempt=$(($attempt+1))
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Mount the master PD as early as possible
|
||||||
|
echo "/dev/xvdb /mnt/master-pd ext4 noatime 0 0" >> /etc/fstab
|
||||||
}
|
}
|
||||||
|
|
||||||
fix-apt-sources() {
|
fix-apt-sources() {
|
||||||
|
Loading…
Reference in New Issue
Block a user