Skip to content

Commit

Permalink
fix: ensure mounted disk are all up
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeo committed Aug 20, 2024
1 parent 91baabd commit 8f02111
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions node/cloud-init.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,20 @@ runcmd:
- /usr/local/bin/install-or-upgrade-rke2.sh
- echo 'alias crictl="sudo /var/lib/rancher/rke2/bin/crictl -r unix:///run/k3s/containerd/containerd.sock"' >> /home/${system_user}/.bashrc
- echo 'alias ctr="sudo /var/lib/rancher/rke2/bin/ctr --address /run/k3s/containerd/containerd.sock --namespace k8s.io"' >> /home/${system_user}/.bashrc
- >
for MNT in /mnt; do
RETRIES=0; MAX_RETRIES=30;
until mountpoint -q "$MNT"; do
RETRIES=$((RETRIES + 1));
if [ $RETRIES -ge $MAX_RETRIES ]; then
echo "ERROR: $MNT not mounted after $MAX_RETRIES retries.";
exit 1;
fi;
echo "$MNT not mounted yet, retrying in 10 seconds...";
sleep 5;
done;
echo "$MNT mounted successfully.";
done;
%{~ if is_server ~}
- systemctl restart systemd-modules-load.service # ensure ipvs is loaded
- echo 'alias kubectl="sudo /var/lib/rancher/rke2/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml"' >> /home/${system_user}/.bashrc
Expand Down

0 comments on commit 8f02111

Please sign in to comment.