Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
lib: mount host loop devices
Browse files Browse the repository at this point in the history
.. to allow the kubelet to gather rootfs info.

Fix #2
  • Loading branch information
schu committed Mar 3, 2018
1 parent b504fea commit 11100a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,13 @@ kubedee::configure_worker() {

lxc config device add "${container_name}" cni-plugins disk source="${kubedee_dir}/clusters/${cluster_name}/rootfs/opt/cni/bin/" path="/opt/cni/bin/"

# Mount the host loop devices into the container to allow the kubelet
# to gather rootfs info when the host root is on a loop device
# (e.g. `/dev/mapper/c--vg-root on /dev/loop1 type ext4 ...`)
for ldev in /dev/loop[0-9]; do
lxc config device add "${container_name}" "${ldev#/dev/}" unix-block source="${ldev}" path="${ldev}"
done

kubedee::log_info "Configuring ${container_name} ..."
cat <<EOF | lxc exec "${container_name}" bash
set -euo pipefail
Expand Down

0 comments on commit 11100a3

Please sign in to comment.